|
Subject: Re: [xsl] Not parsing sub-nodes From: David Carlisle <davidc@xxxxxxxxx> Date: Fri, 9 Mar 2001 09:20:00 GMT |
<xsl:template match="/*">
despite the * in th ematch avove this can only match on one element
as there can only be one element that is the child of the root node.
<xsl:value-of select="."/>
This gives the string value of the document element, that is the
concatenation of _all_ characters that appear as elemet content
_anywhere_ in the document.
<xsl:for-each select="company">
This selects all the company children of the top level company element.
<xsl:apply-templates select="company"/>
For each of those children, this selcts its company children (ie
grandchildren of the top element) in your example document there are none.
</xsl:for-each>
</xsl:template>
<xsl:template match="office">
This template will never be called as your company tempate never applies
templates to anything other than company nodes.
<xsl:value-of select="."/>
This returns the character data of the element but this is the empty
string as th eelemnt is empty.
<xsl:apply-templates select="office"/>
This selects all office children of the office node, but office nodes
are empty so this does nothing.
</xsl:template>
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Not parsing sub-nodes, Roshan Sharma | Thread | Re: [xsl] Not parsing sub-nodes, Jeni Tennison |
| Re: [xsl] [XSL] Get time and data, Joerg Pietschmann | Date | Re: [xsl] Not parsing sub-nodes, Jeni Tennison |
| Month |