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
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.


if I give the xslt program book, the program should return

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="";
version="1.0" >

  <xsl:template match="/" >
      <xsl:apply-templates select="//book" />

   <xsl:template match="book" >
    <xsl:apply-templates />

Get Your Private, Free E-mail from MSN Hotmail at

Share information about yourself, create your own public profile at

XSL-List info and archive:

Current Thread