[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to add a "less than" or "greater than" sign?

Subject: Re: How to add a "less than" or "greater than" sign?
From: "John E. Simpson" <simpson@xxxxxxxxxxx>
Date: Wed, 12 Apr 2000 15:57:55 -0400
greater than sign
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@xxxxxxxxxxx      |



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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.