[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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


Subject: Re: That didnt work either! RE: How to add a "less than" or "greater than" sign?
From: "John E. Simpson" <simpson@xxxxxxxxxxx>
Date: Wed, 12 Apr 2000 19:49:15 -0400

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@xxxxxxxxxxx      |


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




Current Thread
Keywords