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

Re: hierarchic counting in flat structures

Subject: Re: hierarchic counting in flat structures
From: Norbert Heidbrink <nh@xxxxxxxx>
Date: Fri, 2 Nov 2012 14:52:30 +0100
Re:  hierarchic counting in flat structures
Hi Michael,

[Michael Kay]:
> <xsl:number from="H3" level="any"/>
>
> It's not the usual use case given for level="any", but I think it
> should work, provided that an H3 actually exists.

That works - almost. :-)
One detail remains to be dealt with.

The input XML I am working on is not the most professional one. ;-)

<DOK>
<H3>b&</H3>
  <H4>b&</H4>          <- "outer H4"
  <some>
    <tag>
      <H4>b&</H4>          <- "inner H4"
    </tag>
  </some>
  <H4>b&</H4>         <- "outer H4"
  b&
</DOK>

Of course, your solution counts all the "inner H4", too.
However, I don't want these to be be considered.

So, I extend your proposal a bit:
<xsl:number count="DOK/H4" from="H3" level="any"/>

And there we go - this yields the result I have been looking for.

Thanks for your help,
best wishes,
Norbert

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.