[xsl] Namespace questions

Subject: [xsl] Namespace questions
From: Ayelet Kotzer <akotzer@xxxxxxxxxxx>
Date: Fri, 29 Dec 2000 13:41:34 -0800
Hi All,

  I have the following questions:

  1.  Below are the input and output required. The XSL I wrote and the
actual result.  Do you know how should I make it work ?

   Input:
    <m:A   xmlns:m="B">
        <A1>something </A1>
         <A2  att="att1>something </A2>
    </m:A>

  Output:
   <A >
        <A1>something </A1>
         <A2  att="att1>something </A2>
    </A>

   Part of  my XSL - In this moment just trying to copy the child's
element (A1, A2)

   <xsl:template match="">
     <xsl:apply-templates/>
   </xsl:template>

 <xsl:template match="*  | @* |  comment()   |  text() |
processing-instruction()">
  <xsl:copy>
   <xsl:apply-templates select="* | @* | comment() | text() |
processing-instruction() "/>
  </xsl:copy>
 </xsl:template>

 <xsl:template match="text()">
  <xsl:value-of select="."/>
 </xsl:template>


What I got is something like this:
<A1   xmlns:m="B">something </A1>
  <A2  xmlns:m="B"  att="att1 >something </A2>


2. I have to output this line  :
    <m:A   xmlns:m="B">

   This line is some where in the tree (not top and not first child) . I
tried to use   xsl:element . It complained (Xalan processor) that it
doesn't know  m.
    I solved this problem by using xsl:text . Which is not very elegant
solution. I wander if you have a better one ?

Thanks,
Ayelet








 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread