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

RE: Storing and retrieving html tags in a variable

Subject: RE: Storing and retrieving html tags in a variable
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 12 Sep 2003 10:59:27 +0100
retrieving html
> This doesn't seem to work:
>    <xsl:variable name="doofus">
>      <a href="doofus.html">click to go to doofus</a>
>    </xsl:variable>
>    <xsl:value-of select="$doofus"/>
> 
> The resulting output is just "click to go to doofus", not
> "<a href="doofus.html">click to go to doofus</a>."
> 
> Any way to store html tags in a variable,
> or to accomplish this by some other means?

Read up about the XPath data model. There is no such thing as a tag in
this model, elements and attributes are represented by nodes. The value
of your variable is a result tree fragment, consisting of a root node,
an <a> element node, an href attribute node, and a text node. You can
copy this tree fragment to the result tree, using a deep copy that
copies all these nodes except the root, by using <xsl:copy-of>. The
<xsl:value-of> instruction converts the argument to a string, and the
string-value of an element node or document root node is the
concatenation of its descendant text nodes.

Michael Kay


 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.