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

Constructing hierarchical XML from a flat XML-tag sequ

Subject: Constructing hierarchical XML from a flat XML-tag sequence using XSLT
From: Lars Eskildsen <laes@xxxxxxxxx>
Date: Tue, 27 Aug 2002 12:35:10 +0200
lars eskildsen
Hello!

I want to be able to convert XML code like

<XMLCODE>
<a/><b/><c/><d/><a/><b/><c/><d/><a/><b/><c/><d/><a/><b/><c/><d/>
</XMLCODE>

to the following XML:

<NEWXMLCODE>
<a>
	<b/>
	<c/>
	<d/>
</a>
<a>
	<b/>
	<c/>
	<d/>
</a>
<a>
	<b/>
	<c/>
	<d/>
</a>
</NEWXMLCODE>

The DTD for the input XML is:	<!ELEMENT XMLCODE (a | b | c | d)+>
				a, b, c, d are empty tags

The DTD for the output XML is:	<!ELEMENT NEWXMLCODE (a+)>
                                                <!ELEMENT a (b | c | d)*>
				b, c, d are empty tags

Can this be done? and how? 
I just can't figure it out!

/Lars Eskildsen



** Stibo Graphic          | Søren Nymarks Vej 21 | DK-8270 Højbjerg 
** mailto:laes@xxxxxxxxx  | http://www.stibographic.com 
** Phone:  +45 8939 8939  | Fax:    +45 8939 8940
** Direct: +45 8939 7421


 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.