Subject: [xsl] Path according to a child node attribute From: "Gian Paolo Bernardini" <eu1517395@xxxxxxxxx> Date: Sat, 31 Dec 2011 11:36:19 +0100 |
Hi all, Many thanks to Markus Abt for the solution to a previous post. For now I'm struggling on a path building, according to a child node attribute Supposing an xml hierarchically ordered like this: <?xml version="1.0" encoding="UTF-8"?> <root> <Class code="B"> <SubClass code="b1"/> <SubClass code="b2"/> <Rubric>FUNZIONI CORPOREE</Rubric> </Class> <Class code="b1"> <SuperClass code="B"/> <SubClass code="b110-b139"/> <Rubric>FUNZIONI MENTALI</Rubric> </Class> <Class code="b110-b139"> <SuperClass code="b1"/> <SubClass code="b110"/> <Rubric>FUNZIONI MENTALI GLOBALI</Rubric> </Class> <Class code="b110"> <SuperClass code="b110-b139"/> <Rubric>Funzioni della coscienza</Rubric> </Class> <Class code="b2"> <SuperClass code="B"/> <SubClass code="b210-b229"/> <Rubric>FUNZIONI SENSORIALI E DOLORE</Rubric> </Class> <Class code="b210-b229"> <SuperClass code="b2"/> <SubClass code="b210"/> <Rubric>FUNZIONI VISIVE E CORRELATE</Rubric> </Class> <Class code="b210"> <SuperClass code="b210-b229"/> <Rubric>Funzioni della vista</Rubric> </Class> </root> I'd like to transform it in a form like this: <?xml version="1.0" encoding="UTF-8"?> <root> <Class code="B"> <SubClass code="b1"/> <SubClass code="b2"/> <Rubric>FUNZIONI CORPOREE</Rubric> <Path></Path> </Class> <Class code="b1"> <SuperClass code="B"/> <SubClass code="b110-b139"/> <Rubric>FUNZIONI MENTALI</Rubric> <Path>B FUNZIONI CORPOREE</Path> </Class> <Class code="b110-b139"> <SuperClass code="b1"/> <SubClass code="b110"/> <Rubric>FUNZIONI MENTALI GLOBALI</Rubric> <Path>B FUNZIONI CORPOREE/b1 FUNZIONI MENTALI</Path> </Class> <Class code="b110"> <SuperClass code="b110-b139"/> <Rubric>Funzioni della coscienza</Rubric> <Path>B FUNZIONI CORPOREE/b1 FUNZIONI MENTALI/b110-b139 FUNZIONI MENTALI GLOBALI</Path> </Class> <Class code="b2"> <SuperClass code="B"/> <SubClass code="b210-b229"/> <SubClass code="b230-b249"/> <Rubric>FUNZIONI SENSORIALI E DOLORE</Rubric> <Path>B FUNZIONI CORPOREE</Path> </Class> <Class code="b210-b229"> <SuperClass code="b2"/> <SubClass code="b210"/> <Rubric>FUNZIONI VISIVE E CORRELATE</Rubric> <Path>B FUNZIONI CORPOREE/b2 FUNZIONI SENSORIALI E DOLORE</Path> </Class> <Class code="b210"> <SuperClass code="b210-b229"/> <Rubric>Funzioni della vista</Rubric> <Path>B FUNZIONI CORPOREE/b2 FUNZIONI SENSORIALI E DOLORE/b210-b229 FUNZIONI VISIVE E CORRELATE</Path> </Class> <Class code="b230-b249"> <SuperClass code="b2"/> <Rubric>FUNZIONI UDITIVE VESTIBOLARI</Rubric> <Path>B FUNZIONI CORPOREE/b2 FUNZIONI SENSORIALI E DOLORE</Path> </Class> </root> I'm founding difficulties on adding a child element as last child of the node (i.e. <Path>) and on making the right path building (i.e. accessing the attributes and values of the father, of the grandfather or of the great grandfather based on the SuperClass code of each Class). Using SaxonHE9-4-0-1J. Any ideas? Thanks in advance GB
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] where's here the error, Roelof Wobben | Thread | Re: [xsl] Path according to a child, Martin Honnen |
Re: [xsl] where's here the error, Andrew Welch | Date | Re: [xsl] Path according to a child, Martin Honnen |
Month |