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

New XSL user seeking assistance!

Subject: New XSL user seeking assistance!
From: Matt Sims <matt.sims@xxxxxxxx>
Date: Tue, 05 Jul 2005 13:10:32 +0100
matt sims
Hi,

I'm faced with a problem that I believe XSL may be able to help me with,
but having only just discovered XSL I am having difficulty in
implementing the solution!

Basically, I have some XML that is used in a custom .NET application for
the display of formatted text.  Here's an example to demonstrate the format:

<text>
   <font number="5">
       Hello
       <colour number="3">
           <indent x="1" y="2">
              World
           </indent>
      </colour>
   </font>
</text>

My problem is that due to the way the XML is generated by the
application, I often get nested elements of the same type that I need to
'merge' together into one, while summing the attribute values of the
merged nodes, i.e.:

<text>
   Hello
   <indent x="1" y="2">
       <indent x="6" y="-1">
           World
       </indent>
   </indent>
</text>

needs to become:

<text>
   Hello
   <indent x="7" y="1">
       World
   </indent>
</text>

There is no limit to how deep the nesting can be, but only certain types
need to be merged (eg. in this case, only 'indent' elements).  Elements
such as 'font' and 'colour' simply override any previous elements of the
same type so are not a problem.  Obviously, nodes of the same type need
only be merged when they are immediate descendants of each other, as
opposed to having text between.

I'm using the System.Xml.Xsl library of V2.0 of the .NET framework, so I
assume this will support V2.0 of the XSLT specification if required.
Any other questions, please ask.

Thanks in advance for any answers you may be able to give me!

Kind regards,

Matt Sims.

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.