This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: apply-templates Q
- To: <xsl-list at mulberrytech dot com>
- Subject: RE: apply-templates Q
- From: "Mike Ball" <mike dot ball at softwareag dot co dot uk>
- Date: Wed, 1 Nov 2000 10:00:32 -0400 (EST)
- Reply-To: xsl-list at mulberrytech dot com
Hi Maulik
You say:-
> here is the problem.
>
> My XML is as follows:
>
> <data>
> <Dates>
> <Date>
> <Weeks>
> <Week>some value...</Week>
> <Date>some value...</Date>
> </Weeks>
> </Date>
> </Dates>
> </data>
>
> My XSL snippet is:
>
> <xsl:template match="/">
>
> some testing...and tables...
>
> <xsl:apply-templates select="//Date" />
> </xsl:template>
>
> I want the <xsl:apply-templates> to only select the main <Date>
> element and
> not the <Date> element within the <Weeks> node. Unfortunately I have no
> control over the XML file. Any help is appreciated.
>
Just change
<xsl:apply-templates select="//Date" />
to
<xsl:apply-templates select="/Dates/Date" />
This selects just "Date" within "Dates".
Hope that helps.
Mike Ball
Application Services Consultant
Software AG UK
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list