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]

RE: Transforming non structured XML into structured XML with XSLT


You'll find out all about doing grouping in XSLT at
http://www.jenitennison.com/xslt/grouping.

But for a problem like this, if you know Java, it's an awful lot easier to
write a SAX filter that does the job.

Mike Kay
Software AG

> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of
> bruno.o.faure@bnpparibas.com
> Sent: 08 August 2001 14:08
> To: XSL-List@lists.mulberrytech.com
> Subject: [xsl] Transforming non structured XML into
> structured XML with
> XSLT
>
>
> 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
>


 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]