[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Re: listing elements & sub-elements in a seqence -

Subject: RE: Re: listing elements & sub-elements in a seqence - skiping elemts if sub-elemts are present
From: cknell@xxxxxxxxxx
Date: Mon, 24 Jul 2006 10:43:58 -0400
seqence
I, too had trouble understanding the requirement, but what caught my attention was the use of xsl:for-each. It looks (at first glance) like another mis-use of xsl:for-each where the correct approach would be to define two templates:

<xsl:template match="section[not(subsection)]">
 ...
</xsl:template>

and 

<xsl:template match="section[subsection]">
 ...
</xsl:template>

Then simply apply-templates.

-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     David Carlisle <davidc@xxxxxxxxx>
Sent:     Mon, 24 Jul 2006 15:33:05 +0100
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Re:  listing elements & sub-elements in a seqence - skiping elemts if sub-elemts are present


  1) Whether the above code is correct or not, pls can forward me the
  syntax code equivalent to <for-each - //section[with no subsection] |
  //section/subsection..>

I didn't follow the rest of your problem statement, but if you put in
the obvious missing syntax bits like ="..." then essentially what you
write is legal Xpath to select the elements that you want.


<xsl:for-each select="//section[not(subsection]|//section/subsection"

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.