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

Help: amalgamate a series of consecutive mixed nodes

Subject: Help: amalgamate a series of consecutive mixed nodes
From: "Trevor Nicholls" <trevor@xxxxxxxxxxxxxxxxxx>
Date: Tue, 14 Feb 2006 15:16:33 +1300
mixed nodes
Within some XML that I am processing are structures like the following:

<list>
  <item>...</item>
  <item>...</item>
</list>
<indent>...</indent>
<list>
  <item>...</item>
</list>

This structure does not mirror the document structure very well, because
logically the <indent> element is part of the <list>; it's a follow on from
the immediately preceding <list>/<item> element. But the XML reflects the
document formatting rather than the content :-(

If the requirement was simply to handle a single <indent> which followed a
<list> then I could manage it quite easily, by having a special <item>
template for the last <item> in a <list> whose first following-sibling was
an <indent>, and a null template for an <indent> whose first
preceding-sibling was a <list>. However it's not quite as straight forward
as this, because where I have an <indent> in my example I could in fact have
a series of elements, e.g. a mixed sequence of <indent>, <Sindent>, <SBody>,
and others.

So what I am after is (I suppose) a special template for the last <item> in
a <list> which is followed by one or more siblings whose names match a list
of permitted "followers", and a null template for any of these followers
which have a <list> amongst their preceding siblings, and which only have
permitted "followers" between themselves and the nearest <list>.

I'm finding that difficult enough to specify in English, and it's certainly
beyond me in XSL. Has anyone solved this kind of structural problem before?

Thanks
Trevor

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.