This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: parent()
/ "Spychalski, Frank" <frank.spychalski@sap.com> was heard to say:
[...]
| produces the following output:
|
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
| "http://www.w3.org/TR/REC-html40/strict.dtd">
| <document foo="123"
| xmlns:xsp="http://www.apache.org/1999/XSP/Core"></document>
|
| <!-- This page was served in 20 milliseconds by Cocoon 1.7.4 -->
|
| Why isn't it:
|
| <document foo="123"
| xmlns:xsp="http://www.apache.org/1999/XSP/Core">123</document>
| ^^^
| any hints?
Because...
| <xsl:template match="document">
| <document>
| <xsl:attribute name="foo">123</xsl:attribute>
This sets the foo attribute of the document element *in the result tree*
to 123.
| <xsl:value-of select="@foo"/>
And this returns the value of the foo attribute on the document element
*in the source tree*.
| </document>
| </xsl:template>
| </xsl:stylesheet>
Be seeing you,
norm
--
Norman.Walsh@East.Sun.COM | What is more wonderful than the delight
XML Technology Center | which the mind feels when it *knows*? This
Sun Microsystems, Inc. | delight is not for anything beyond the
| knowing, but is in the act of knowing. It
| is the satisfaction of a primary
| instinct.--Mark Rutherford
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list