This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How to add a "less than" or "greater than" sign?
- To: xsl-list at mulberrytech dot com
- Subject: Re: How to add a "less than" or "greater than" sign?
- From: "John E. Simpson" <simpson at polaris dot net>
- Date: Wed, 12 Apr 2000 15:57:55 -0400
- References: <33DDC954510AD411B46400A0C9C732D6048E12@exch-klip.btg.com>
- Reply-To: xsl-list at mulberrytech dot com
At 01:44 PM 4/12/2000 -0500, Moazzam Ahmed wrote:
>Im trying to create this as the output
>
><ATAG> myvalue </ATAG>
>
>ATAG is an attribute value stored in TYPE
>
>why wont this work
>
>< <xsl:value-of select="@Type"> > myvalue </ <xsl:value-of select="@Type"> >
The reason it doesn't work is that the rules of XML itself forbid this kind
of thing -- nothing really to do with XSLT. Since your stylesheet is itself
an XML document, you can't double-up on the < and > characters within the
stylesheet's tags any more than you can in any other XML document.
If, as I suspect, you're trying to create an element whose name depends on
the value of an attribute, you might want to take a look at using
xsl:element. This works something like the following (don't have an XSLT
processor handy to test it):
<xsl:element name="@Type"> myvalue </xsl:element>
which places into the result tree an element named ATAG (*if* the value of
the Type attribute is "ATAG"), which contains the string " myvalue ".
================================================================
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