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

Re: Group processing / Muench method with MSXML or XSL

Subject: Re: Group processing / Muench method with MSXML or XSLT 1.0
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Tue, 2 Jan 2007 06:01:41 -0800
Re:  Group processing / Muench method with MSXML or XSL
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

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






On 1/2/07, Michael Ruck <lists@xxxxxxxx> wrote:
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

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.