Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: using html in variables [Thread Next] Re: using html in variablesTo: NULL Date: 8/6/2008 9:51:00 AM Tue, 5 Aug 2008 11:03:41 -0700 (PDT), /David Schwartz/: > Tue, 05 Aug 2008 18:29:16 +0200, /Martin Honnen/: > >> If your variable contains a result tree fragment then you need to use >> xsl:copy-of instead of xsl:value-of e.g. >> <xsl:copy-of select="$bar"/> > > That was it! Can you explain what the issue was a bit more fully? <http://www.w3.org/TR/xslt#value-of>: > The xsl:value-of element is instantiated to create a text node in > the result tree. The required select attribute is an expression; > this expression is evaluated and the resulting object is converted > to a string as if by a call to the string function. [...] > > The xsl:copy-of element can be used to copy a node-set over to the > result tree without converting it to a string. See [11.3 Using > Values of Variables and Parameters with xsl:copy-of]. You could read about the 'string' function <http://www.w3.org/TR/xpath#function-string> and what is the string-value of root (and element) nodes <http://www.w3.org/TR/xpath#dt-string-value> (a bit down below). Such node is the one in your variable result-tree-fragment value <http://www.w3.org/TR/xslt#dt-result-tree-fragment>. -- Stanimir | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
