[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: parent()


Subject: Re: parent()
From: Norman Walsh <ndw@xxxxxxxxxx>
Date: 10 Jul 2000 16:51:13 -0400

/ "Spychalski, Frank" <frank.spychalski@xxxxxxx> 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@xxxxxxxxxxxx | 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



Current Thread
Keywords
xml