[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
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
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
Re: how can I get the subelement
Subject: Re: how can I get the subelement From: "edmund mitchell" <edmund_mitchell@xxxxxxxxxxx> Date: Mon, 13 Nov 2000 15:52:08 HST |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: how can I get the subelement, liying | Thread | Re: how can I get the subelement, liying |
fixed record length file conversion, Albert Tsun | Date | RE: Equivalent of a Global Counter, Matthew Bentley |
Month |
Keywords