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

Re: sort xml


sort xml
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@s...>

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.