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

conditional processing driven by comparison

Subject: conditional processing driven by comparison
From: Jean-Roch Meurisse <jrm@xxxxxxxxxxxxxxxx>
Date: Thu, 04 Mar 2004 09:30:03 +0100
globalconcept
Hi,

I've just joined the list (I'm a XSLT newbie) and can't find in the archives a response to my problem.
My purpose is to transform the following xml structures into valid xml-schema structures.
example
<myelement name="globalConcept">
<mychoice>
<mygroup>
<myelement ref="subconcept1"/>
<myelement ref="subconcept2"/>
</mygroup>
<mygroup>
<myelement ref="subconcept3"/>
<myelement ref="subconcept4/">
</mygroup>
<mygroup>
<myelement ref="subconcept3"/>
<myelement ref="subconcept4"/>
<myelement ref="subconcept5"/>
</mygroup>
<mygroup>
<myelement ref="subconcept1"/>
<myelement ref="subconcept2"/>
</mygroup>
</mychoice>
</myelement>


should be transformed to
<element name="globalConcept">
	<complexType>
		<choice>
			<sequence>
				<element ref="subconcept1"/>
				<element ref="subconcept2/>
			</sequence>
			<sequence>
				<element ref="subconcept3"/>
				<element ref="subconcept4"/>
				<element ref="subconcept5" minOccurs="0"/>
			</sequence>
		</choice>
	</complexType>
</element>

Furthermore, if all "mygroup" nodes are identical, it should produce only one sequence directly under the complexType element (without the choice element)
I would yet be satisfied with a transformation only copying group nodes but eliminating duplicates (in the example copying the 3 first groups and eliminating 4th)


thank you all in advance

JR


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.