OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] sort xml

[ Lists Home | Date Index | Thread Index ]

Tomas Olsson wrote:
> Hi!
> I want to sort a XML document and then get another  XML document.
> How should I do?
> Is it possible to use XSLT to sort a document and then get a XML document
> in return? 

Yes.  You're looking for the xsl:sort element to use in an 
xsl:for-each or xsl:apply-templates element.

> I dont want the result to be in HTML or text, I want a XML
> document or a DOM tree as a result.

There's an obvious misunderstanding here.  XML is the "natural" 
output format for XSLT.  Strictly, XSLT outputs a tree but this 
is usually serialised to XML unless:

1. You ask specifically for something else (HTML, flat text
   or whatever) or

2. The first top level element of your output is named "HTML" 
   and you don't tell it specifially to use some other format.

You tell it the output format required using the method
attribute of the xsl:output element.

> Im using JavaScript and MSXML. how should I do?

Sorry, I don't know but would also be interested to hear.
I've only used Saxon standalone until now but might well find
myself using MSXML from VB soon.

Ed Davies.

  • References:
    • sort xml
      • From: Tomas Olsson <tomas.olsson@soderhamn.mail.telia.com>


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS