[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
> 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
|
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
|