This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: how can I get the subelement
- To: xsl-list at mulberrytech dot com
- Subject: Re: how can I get the subelement
- From: "edmund mitchell" <edmund_mitchell at hotmail dot com>
- Date: Mon, 13 Nov 2000 15:52:08 HST
- Reply-To: xsl-list at mulberrytech dot com
liying
Your template <xsl:apply-templates select="//book" />
is selecting any <book> element anywhere in the document, but you seem to
only care to process it's element children, so if you match it like:
<xsl:apply-templates select="//book/*" />
then you'll get title, price and author.
If you substitute title in that template:
<xsl:apply-templates select="//title/*" />
you won't get anything, because <title> has no element children.
I'm not sure what you're after, but I hope that helped.
Edmund
><book>
>
>if I give the xslt program book, the program should return
>title
>price
>author
>
>
>if I give the xslt program title, then it should return nothing
>
>but my program give me the text of what contain in the end-element
>
>here is my program
>
><?xml version="1.0" ?>
><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>version="1.0" >
>
> <xsl:template match="/" >
> <xsl:apply-templates select="//book" />
> </xsl:template>
>
> <xsl:template match="book" >
> <xsl:apply-templates />
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list