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

RE: placing XML inside node attribute

Subject: RE: placing XML inside node attribute
From: "Ben Robb" <Ben@xxxxxxxxxx>
Date: Tue, 19 Nov 2002 17:01:26 -0000
xml inside 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


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.