This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Constructing hierarchical XML from a flat XML-tag sequence using XSLT


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@stibo.com  | 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]