[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] New XSL user seeking assistance!
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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|