xsl-list
[Top] [All Lists]

RE: Loading XML with XSL for sorting in ASP

2006-01-24 04:59:49
Show us what output you hope to get, and you will most likely receive some 
help. Guessing is not conducive to good results. The ASP is irrelevant to your 
problem, the expected output is.
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Bjorn Van Blanckenberg <bjornvb(_at_)ppc(_dot_)be>
Sent:     Tue, 24 Jan 2006 12:32:55 +0100
To:       xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject:  [xsl] Loading XML with XSL for sorting in ASP

My problem is that I want to sort  all the DVD nodes of my XML and  
use asp to convert it to html.
the XSL just has to sort all the DVD and the settingsnode may not be  
altered.

If it's possible I want to sort every othernode by name in evry DVDnode.

Can somebody help me with the XSL because now it seems that I dont  
get any output

Below I've posted a piece of the ASP code and XML and full XSL

Thanks Bjorn



my ASP

'Load the XML file.
        set objXMLbron = Server.CreateObject("Microsoft.XMLDOM")
        objXMLbron.async = false
        objXMLbron.load(xmlFile)
        
        'Load the XSL file.
        set objXSL = Server.CreateObject("Microsoft.XMLDOM")
        objXSL.async = false
        objXSL.load(server.MapPath("sorttit3.xsl"))

        set objXML = Server.CreateObject("Microsoft.XMLDOM")
        'load transformed unsorted XMl and sort it
        objXML.loadXML(objXMLbron.transformNode(objXSL))

        set objXML = objXMLbron.transformNode(objXSL)
        
        Set objRoot = objXML.documentElement

my XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
        <settings>
                <user>
                        <owner>User1</owner>
                        <other>
                                <name>User2</name>
                                <total>3</total>
                                <nodig>-5</nodig>
                        </other>
                        <other>
                                <name>User3</name>
                                <total>14</total>
                                <nodig>6</nodig>
                        </other>
                </user>
                <user>
                        <owner>User2</owner>
                        <other>
                                <name>User1</name>
                                <total>8</total>
                                <nodig>5</nodig>
                        </other>
                        <other>
                                <name>User3</name>
                                <total>7</total>
                                <nodig>-2</nodig>
                        </other>
                </user>
                <user>
                        <owner>User3</owner>
                        <other>
                                <name>User1</name>
                                <total>33</total>
                                <nodig>-6</nodig>
                        </other>
                        <other>
                                <name>User2</name>
                                <total>9</total>
                                <nodig>2</nodig>
                        </other>
                </user>
        </settings>
        <DVD>
                <title>The title</title>
                <year>The Year</year>
                <owner>User3</owner>
                <counter>1</counter>
                <other>
                        <name>User3</name>
                        <status>ok</status>
                        <finalstatus>ok</finalstatus>
                </other>
                <other>
                        <name>User2</name>
                        <status>see</status>
                        <finalstatus>waiting</finalstatus>
                </other>
                <other>
                        <name>User1</name>
                        <status>ok</status>
                        <finalstatus>ok</finalstatus>
                </other>
        </DVD>
</catalog>

my XSL

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ 
Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/catalog">
   <xsl:apply-templates>
    <xsl:sort select="title" />
   </xsl:apply-templates>
</xsl:template>

<xsl:template match="node()|@*">
   <xsl:copy>
    <xsl:apply-templates select="node()|@*">
     <xsl:sort select="title" />
    </xsl:apply-templates>
   </xsl:copy>
</xsl:template>

</xsl:stylesheet>

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>