Subject: [xsl] Group processing / Muench method with MSXML or XSLT 1.0 From: Michael Ruck <lists@xxxxxxxx> Date: Tue, 2 Jan 2007 14:46:40 +0100 |
I try to transform XML-Tags which can combined as groups to HTML-Lists (ordered and unordered).
<EinzugListe> <Einzug aufz="1." level="0">Some Text 1 - Level 0</Einzug> <Einzug aufz="-" level="1">Some Text 1 - Level 1</Einzug> <Einzug aufz="-" level="1">Some Text 2 - Level 1</Einzug> <Einzug aufz="" level="1">Some more Text</Einzug> <Einzug aufz="-" level="2">Some Text 1 - Level 2</Einzug> <Einzug aufz="-" level="2">Some Text 2 - Level 2</Einzug> <Einzug aufz="2." level="0">Some Text 2 - Level 0</Einzug> </EinzugListe>
<ol> <li>Some Text 1 - Level 0 <ul> <li>Some Text 1 - Level 1</li> <li>Some Text 2 - Level 1<br /> Some more Text <ul> <li>Some Text 1 - Level 2</li> <li>Some Text 2 - Level 2</li> </ul> </li> </ul> </li> <li>Some Text 2 - Level 0</li> </ol>
For the transformation I will use the following XSLT 2.0 code (without the decision if ul or ol):
<xsl:template match="EinzugListe"> <ul> <xsl:call-template name="ebene"> <xsl:with-param name="liste" select="Einzug"/> <xsl:with-param name="level" select="0"/> </xsl:call-template> </ul> </xsl:template> <xsl:template name="ebene"> <xsl:param name="liste"/> <xsl:param name="level"/> <xsl:for-each-group select="$liste" group-starting-with="*[xs:integer(@level) eq $level]"> <li> <xsl:value-of select="normalize-space(.)"/> <ul> <xsl:call-template name="ebene"> <xsl:with-param name="liste" select="current-group() except ."/> <xsl:with-param name="level" select="$level + 1"/> </xsl:call-template> </ul> </li> </xsl:for-each-group> </xsl:template>
I found the code in the List, modified it and it works fine until I will use Saxon as transform-processor which supports XSLT 2.0.
But the transformation has to be made on a Windows computer and there I only have the MSXML as transform-processor (because the transformation is part of an VBA-MSAccess2000-project). I read that MSXML does not (and will not) support XSLT 2.0 and so I am looking for a possibility to make the same transformation only with XSLT 1.0 functions. Or is there a possibility to use an other tranform-processor for the VBA-project (I read something about System.Xml, but I don't know how to include it in MSAccess2000 so I can use it in my VBA-project).
Thanks for your tipps, hints and code-samples (maybe including the decision if ul, ol or br (see example above))
---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] The prefix "svg" for elem, Nico Van Cleemput | Thread | Re: [xsl] Group processing / Muench, Dimitre Novatchev |
Re: [xsl] The prefix "svg" for elem, Nico Van Cleemput | Date | Re: [xsl] Group processing / Muench, Dimitre Novatchev |
Month |