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

node concatenation

Subject: node concatenation
From: "bix xslt" <bix_xslt@xxxxxxxxxxx>
Date: Fri, 28 Mar 2003 23:54:20 +0000
xslt concatenation
All,

I believe this may have been covered before with some of the grouping q/a's but I did a few searches both on the fact and the archive, and I was unable to find what I was looking for.

Essentially, I've got something similar to the following:
~~~~xml fragment~~~~
<element name="a">
 <attribute name="attA1"/>
 <attribute name="attA2"/>
 <element name="aa">
   <attribute name="attAA1"/>
   <attribute name="attAA2"/>
 </element>
</element>
<element name="b" />
<element name="a">
 <attribute name="attA3"/>
 <attribute name="attA4"/>
 <element name="ab">
   <attribute name="attAB1"/>
   <attribute name="attAB2"/>
   <element name="aba">
     <attribute name="attABA1"/>
     <attribute name="attABA2"/>
     <attribute name="attABA3"/>
     <attribute name="attABA4"/>
   </element>
 </element>
</element>
<element name="a"/>
<element name="b">
 <element name="ba"/>
</element>

I would like to combine all of the similar elements and reference the element children into something like this:
~~~ xml fragment output ~~~
<element name="a">
<attribute name="attA1"/>
<attribute name="attA2"/>
<attribute name="attA3"/>
<attribute name="attA4"/>
<elementRef name="aa"/>
<elementRef name="ab"/>
</element>
<element name="b">
<elementRef name="ba"/>
</element>
<element name="aa">
<attribute name="attAA1"/>
<attribute name="attAA2"/>
</element>
<element name="ab">
<attribute name="attAB1"/>
<attribute name="attAB2"/>
<elementRef name="aba">
</element>
....etc


I am attempting to come up with an automated way of storing off what the DTD is of the xml data produced by my database. My hope is that I can transform my original xml into this newer format (element/attribute), and then transform that into a DTD file. I have an xsl file that works through all of the original xml data and produces what you see above. However, I'm at a loss how to group/concatenate the multiple data outputs. If there is a better way to do this, I'd sure appreciate the help.

Thanks!
bix





_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.