Subject: Re: [xsl] Group processing / Muench method with MSXML or XSLT 1.0 From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx> Date: Tue, 2 Jan 2007 06:01:41 -0800 |
so I am looking for a possibility to make the same transformation only with XSLT 1.0 functions. http://jenitennison.com/xslt/grouping/index.xml
-- Cheers, Dimitre Novatchev --------------------------------------- Truly great madness cannot be achieved without significant intelligence. --------------------------------------- To invent, you need a good imagination and a pile of junk ------------------------------------- You've achieved success in your field when you don't know whether what you're doing is work or play
Hi Folks,
I try to transform XML-Tags which can combined as groups to HTML-Lists (ordered and unordered).
First an example of the XML-Code:
<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>
This should be transformed to the following HTML-Code:
<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))
Best regards,
Michael
---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Group processing / Muench met, Michael Ruck | Thread | Re: [xsl] mod position() tests posi, Abel Braaksma |
[xsl] Group processing / Muench met, Michael Ruck | Date | Re: [xsl] mod position() tests posi, Abel Braaksma |
Month |