This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Parameter problem
- From: Mike Brown <mike at skew dot org>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 13 Mar 2002 12:59:55 -0700 (MST)
- Subject: Re: [xsl] Parameter problem
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hellstern, Manny wrote:
> For simplification, I'm now trying this:
>
> <INTROMSG>
> Please click on the <img id="imgAlert"
> src="http://aaa/images/pic.gif" /> in order to continue.
> </INTROMSG>
>
> and in XSL I'm doing this:
>
> <p id="pInstructions"><xsl:value-of select="//INTROMSG"></p>
>
> but my result is still:
>
> Please click on the in order to continue.
>
> however, if I change my XSL to:
>
> <p id="pInstructions">Please click on the <img id="imgAlert"
> src="http://aaa/images/pic.gif" /> in order to continue.</p>
>
> it works.
>
> What am I missing?
Use xsl:copy-of instead of xsl:value-of.
xsl:value-of means: Create a text node in the result tree. The text in it
should be what XPath calls the "string-value" of the object identified by the
XPath expression in the xsl:value-of's "select" attribute.
//INTROMSG identifies a node-set object consisting of every INTROMSG element
in the document (and perhaps you want to change this to something more
specific). The string-value of a node-set is the string-value of the first
node in that set. The string-value of a node is the concatenation of all its
descendant text nodes; nothing else. The 'img' element child of the 'INTROMSG'
is not text; it's an empty element.
xsl:copy-of is usually only used with XPath expressions identifying
node-sets, and it means: Create in the result tree an identical copy of the
identified nodes and their descendants.
- Mike
____________________________________________________________________________
mike j. brown | xml/xslt: http://skew.org/xml/
denver/boulder, colorado, usa | personal: http://hyperreal.org/~mike/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list