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

Re: Condition Based Count of Sections

Subject: Re: Condition Based Count of Sections
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 13 Apr 2007 12:44:50 +0200
Re:  Condition Based Count of Sections
Abel Braaksma wrote:
J. S. Rawat wrote:

<sect2 count="2" level="1.1.1"> <ti>SECT2: SECTION TITLE</ti> <p>Paragraph 1: PC DATA IS HERE</p> <p>Paragraph 2: PC DATA IS HERE</p> </sect2> ...

It is towards the direction but
1. <sect2> should not count because its parent <sect1> does not have any <p>

?? You could do something like: <xsl:if test="not(self::sect2 and parent::sect1/p)" > ...

around your xsl:attribute statements.


Perhaps better to change your match clause, which does away the xsl:if. I.e., change:


<xsl:template match="chapter[p] | sect1[p] | sect2[p] | sect3[p]">

into:

<xsl:template match="chapter[p] | sect1[p] | sect2[p][../sect1/p] | sect3[p][../(sect1 | sect2)/p]">

If you stick to XSLT 1.0, you'll have to change the parenthesized expression into two expressions.

-- AB

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.