|
next
|
 Subject: Conditional processing nodes at the same level Author: Steve Glanzel Date: 17 Dec 2004 08:59 AM
|
I have attached a snippet of an XML file created from rich text. The rich text contains a mixture of paragraphs and bullet pointed paragraphs. What I want to do is transform the rich text file while preserving the same formatting, etc.
I am using the same schemas for both ends of the transform and know the paragraphs (contained in the <par> tags) are bulleted when their def attribute equals 11 and continue to be bulleted until the next <par> tag at that node level has a def attribute other than 11.
In functional programming terms the obvious thing to use would be an xls:if select='@def='11' followed by an "for-each", processing any subsequent <par> tags and then breaking when def!="", but with XSLT I can't do this. And I can't use the node list because the <par(s)> I want to bullet are at the same node level and only differentiated by their def attribute.
Would any one be able to suggest a possible alternative(s), etc I could take.
Thanks for any help!
<par def="10">
<run html="false" highlight="none" readingorder="lefttoright">
<font style="bold" />
The Panel will publish information in accordance with the scheme and shall
monitor and review its operation. Please note:
</run>
</par>
<par def="11">
this will be a living document, which will be modified and developed in light of public comment and feedback;
</par>
<par>
sometimes, information may not be provided and the reasons will be given in each instance.
</par>
<par>
[this scheme is not retrospective, and we do not undertake to publish information held by RPA which was generated before 31 December 2003, the date the Scheme came into force];
</par>
<par>information retention periods can vary from class to class.</par>
<par def="6" />
<par>If you have an enquiry about a specific information source, please contact:</par>
<par def="10" />
<par>Customer Relations Unit (CRU)</par>
<par>PO Box 69, Reading,</par>
<par>RG1 3YD,</par>
|
|
|