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

RE: Loading XML with XSL for sorting in ASP

Subject: RE: Loading XML with XSL for sorting in ASP
From: cknell@xxxxxxxxxx
Date: Tue, 24 Jan 2006 06:59:49 -0500
asp load xml
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@xxxxxxxxxx - email



-----Original Message-----
From:     Bjorn Van Blanckenberg <bjornvb@xxxxxx>
Sent:     Tue, 24 Jan 2006 12:32:55 +0100
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:   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>

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.