This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: That didnt work either! RE: How to add a "less than" or "greater than" sign?


At 05:47 PM 04/12/2000 -0500, Moazzam Ahmed wrote:

>couple of you suggested the following. But that returns this :
>
><{@Type}>myvalue</@Type>

Bob duCharme's solution:
     <xsl:element name="{@Type}">myvalue</xsl:element>
does indeed work with XT and with Saxon.

The sample I just ran used this XML:

     <?xml version="1.0"?>
     <?xml:stylesheet type="text/xsl" href="demo1.xsl" ?>
     <root>
     <subelem Type="ATAG"/>
     </root>

and this XSLT:

     <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:template match="subelem">
     <xsl:element name="{@Type}">myvalue</xsl:element>
     </xsl:template>
     </xsl:stylesheet>

What XSLT processor are you using? (That is *always* crucial information to 
provide.)

(Btw, my own "solution," posted shortly before Bob's, matched his except 
for the curly braces around the attribute reference, which are required; 
without them you do indeed get start and end tags <@Type> and </@Type>, 
respectively.)

================================================================
John E. Simpson          | "After they make styrofoam, what do
http://www.flixml.org    | they ship it in?" (Steven Wright)
simpson@polaris.net      |


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]