[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Adil,
At 10:39 AM 3/12/2008, you wrote:
Well the second solution would be quite easy and straightforward: you could generate a number for each Line in sequence, in document-wide scope and irrespective of containment or order of traversal, with
<xsl:number level="any"/>
called with each Line as current node (that is, inside a template matching the Line or in a for-each selecting Lines).
The first requirement is harder, since to calculate the number of each Line within its "virtual" Transaction (that is, its current Transaction plus all the Transactions preceding it up to, but not including, the closest preceding Transaction with a UniqueInfo) means being able to collect its proper "actual" Transactions together from each Line. This could be done in a single pass, but it won't be especially pretty.
It could be done in a second pass quite easily, and you might consider this. The first step of your pipeline would rectify your Transactions, adopting the orphans (as it were); this would make everything in the transformation including the numbering of the lines easier for the second step to handle.
Is this an option for you?
Another solution to your problem might be to use a throwaway identifier, such as the unique ID produced by the generate-id() function for each Line.
Re: [xsl] Manipulating elements depending on the existence of sub-elements
Subject: Re: [xsl] Manipulating elements depending on the existence of sub-elements From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 12 Mar 2008 11:49:03 -0400 |
Adil,
At 10:39 AM 3/12/2008, you wrote:
So basically I want the count to represent the position of a given Line within a given Transaction, and in cases where a UniqueInfo element is not present (i.e. it's a stub of a transaction), I want the line count of that Transaction's following sibling to start where its own line count left off, rather than back at 1 (which is what's happening currently and what should be happening for all other transactions). If this is not possible or more effort than its worth, I'd settle for a line count representing the position of the line in the context of the entire document (so the count just increments with every line). I tried to do the latter by changing the context of position(), but it didn't work out too well so any help would be most appreciated.
Well the second solution would be quite easy and straightforward: you could generate a number for each Line in sequence, in document-wide scope and irrespective of containment or order of traversal, with
<xsl:number level="any"/>
called with each Line as current node (that is, inside a template matching the Line or in a for-each selecting Lines).
The first requirement is harder, since to calculate the number of each Line within its "virtual" Transaction (that is, its current Transaction plus all the Transactions preceding it up to, but not including, the closest preceding Transaction with a UniqueInfo) means being able to collect its proper "actual" Transactions together from each Line. This could be done in a single pass, but it won't be especially pretty.
It could be done in a second pass quite easily, and you might consider this. The first step of your pipeline would rectify your Transactions, adopting the orphans (as it were); this would make everything in the transformation including the numbering of the lines easier for the second step to handle.
Is this an option for you?
Another solution to your problem might be to use a throwaway identifier, such as the unique ID produced by the generate-id() function for each Line.
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Manipulating elements dep, Adil Ladhani | Thread | [xsl] Processing Memory-Hungry Data, Eliot Kimber |
Re: [xsl] [XSLT] Asking or Update v, Sam Byland | Date | RE: [xsl] Manipulating elements dep, Wendell Piez |
Month |
Keywords