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

Transforming non structured XML into structured XML wi

Subject: Transforming non structured XML into structured XML with XSLT
From: bruno.o.faure@xxxxxxxxxxxxxx
Date: Wed, 8 Aug 2001 15:07:46 +0200
xml wi
Hello,

I'm trying to write a XSLT style sheet that transforms a non-structured xml
document to a structured xml document and am in troubles :

My xml documents looks like a flat modelization of a treeview :

<row lib="data1" folder1="A" folder2="C" />
<row lib="data2" folder1="A" folder2="C" />
<row lib="data3" folder1="A" folder2="C" />
<row lib="data1" folder1="A" folder2="D" />
<row lib="data2" folder1="A" folder2="D" />
<row lib="data3" folder1="A" folder2="D" />
<row lib="data1" folder1="B" folder2="E" />
<row lib="data2" folder1="B" folder2="E" />
<row lib="data3" folder1="B" folder2="E" />
<row lib="data1" folder1="B" folder2="F" />
<row lib="data2" folder1="B" folder2="F" />
<row lib="data3" folder1="B" folder2="F" />
<row lib="data1" folder1="B" folder2="G" />
<row lib="data2" folder1="B" folder2="G" />
<row lib="data3" folder1="B" folder2="G" />
<row lib="data1" folder1="B" folder2="H" />
<row lib="data2" folder1="B" folder2="H" />
<row lib="data3" folder1="B" folder2="H" />

Basically the first line means that the folder A contains the folder C  which contains data1
And so on for the others
I would need to transform it in the following structured XML document :

<A>
     <C>
     <data1/>
     <data2/>
     <data3/>
     </C>
     <D>
     <data1/>
     <data2/>
     <data3/>
     </D>
</A>
<B>
     <E>
     <data1/>
     <data2/>
     <data3/>
     </E>
     <F>
     <data1/>
     <data2/>
     <data3/>
     </F>
     [...]
</B>

The XML file is dynamically generated so folder names and folder depth are not know in advance.
I can't see how to do that, and I don't event know if it is possible.

Any help, of any sort, would be much appreciated

Regards

--Bruno




This message and any attachments (the "message") is
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

                ---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le 
"message") sont etablis a l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce 
message par erreur, merci de le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce 
message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf 
autorisation expresse. L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.

 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.