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

RE: Side-effects, state, internal references

Subject: RE: Side-effects, state, internal references
From: Jonathan Marsh <jmarsh@xxxxxxxxxxxxx>
Date: Thu, 16 Apr 1998 12:41:13 -0700
all about state with references
> -----Original Message-----
> From: Norman Walsh [mailto:ndw@xxxxxxxxxx]
> Sent: Thursday, April 16, 1998 11:47 AM
> | One solution might be to build counting behavior directly into the flow
> | objects, such as the HTML <OL> provides.  A more general solution would
> | for XSL to provide counting functions relative to the output tree, e.g.
> | flowObjectChildNumber().
> Those are both possibilities, but it's also possible to simply
> calculate the number correctly from the source grove.  After
> all, if your stylesheet is doing the reordering, it knows what
> reordering it's doing, right? ;-)
I challenge you (in the friendliest way possible :-)) to solve the problem
originally solved in this thread using source-level numbering mechanisms.  I
feel confident that while it is possible, it will be pretty involved,
probably requiring a lot of tree walking from script.

Or alternatively how would you do this correctly?  Given
	<B level="1">first level 1 B</B>
	<B level="2">first level 2 B</B>
	<B level="1">second level 1 B</B>
	<B level="1">third level 1 B</B>
	<B level="2">second level 2 B</B>

I would like this output (the numbers are generated):
	1) first level 1 B
	2) second level 1 B
	3) third level 1 B

In other words, I am filtering out level="2".  This is intended to be a
simple example that shows the general problem of combining numbering with
filtering, reordering or sorting, all of which I expect to be common (nearly
ubiquitous) operations on XML data, and have useful application to XML
documents as well.

> In the reverse case, the proper number for an element in the list

> I've never written a DSSSL stylesheet where I felt that I needed
> either a flow object that could do enumeration automatically or
> the ability to count sosofos.  Which isn't to say that either or
> both of those features might not be useful.
Have you come across this situation in your stylesheets?  I.e. combining
numbering with filtering, reordering or sorting?

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.