|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: placing XML inside node attribute
I'm afraid that this is invalid XML; you cannot put the < character within an attribute. -----Original Message----- From: lpmlabs9@xxxxxxxxxxxx [mailto:lpmlabs9@xxxxxxxxxxxx] Sent: 19 November 2002 16:48 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: placing XML inside node attribute I'm trying to place XML into the attribute of a tag as follows: xml <stock><ticker>ibm</ticker><high>100</high><low>95</low></ticker></stock > desired result <object code="tickerplot.class"> <param name="xml" value="<stock><ticker>ibm</ticker><high>100</high><low>95</low></ticker> </stock>"/> </object> Here is my version of xsl:copy that works for the above case. Is there a better solution? <xsl:template match="*" mode="xslcopy"> <<xsl:value-of select="name()"/> <xsl:text> </xsl:text> <xsl:for-each select="@*"> <xsl:value-of select="name()"/>='<xsl:value-of select="."/>' </xsl:for-each> > <xsl:if test="count(child::node()) < 2"> <xsl:value-of select="."/> </xsl:if> <xsl:apply-templates select="*" mode="xslcopy"/> </<xsl:value-of select="name()"/>> </xsl:template> TIA, Larry Mason __________________________________________________________________ The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








