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

Re: Xalan attribute order

Subject: Re: Xalan attribute order
From: "Anthony B. Coates" <abcoates@xxxxxxxxxxxxx>
Date: Wed, 28 Aug 2002 19:00:25 +0100
xsl xalan attributes
> Thomas Bayer wrote:
> > Hallo,
> > 
> > I know, attribute order doesn't matter, and if order matters, something is
> > wrong. But I generate HTML from XML and there are old tools. So I have to
> > keep the attribute order. I guess Xalan sorts the attributs alphabetically.

> > Is there a way, to change the behaviour of Xalan?

Well, if you are copying from input to output and want to keep the attributes
in alphabetic order, you could so something like

<xsl:template match = "*">
  <xsl:copy>
    <xsl:for-each select = "@*">
      <xsl:sort select = "name()"/>
      <xsl:copy/>
    </xsl:for-each>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

	Cheers,
		Tony.
====
Anthony B. Coates, Data Architect
mailto:abcoates@xxxxxxxxxxxxx
MDDL Editor (Market Data Definition Language)
http://www.mddl.org/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.