This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Xalan attribute order
- From: Joseph Kesselman <keshlam at us dot ibm dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 28 Aug 2002 16:22:30 -0400
- Subject: [xsl] Xalan attribute order
- Reply-to: xsl-list at lists dot mulberrytech dot com
>I know, attribute order doesn't matter, and if order matters,
> something is wrong.
****EXTREMELY**** wrong. Attribute order shouldn't be significant for HTML
either.
> I guess Xalan sorts the attributs alphabetically.
> Is there a way, to change the behaviour of Xalan?
XML parsers do not promise to retain attribute order, so this information
is generally gone before it reaches Xalan. I don't think we deliberately
change the order, but I know we don't make any special effort to maintaiin
it.
You could try to find an XML parser which retains the original order,
connect Xalan to that rather than using the Xerces or Crimson parsers we
generally run with, and see if Xalan "just happens" to then do the right
thing for you.
If it doesn't... I think you're looking at writing some sort of custom
extension of the Xalan HTML serializer which knows what attribute order
works for your tools and sorts them (or feeding Xalan's output into some
other resorting mechanism).
Personally, I would suggest you replace the downstream tools. Nonstandard
patches to support broken behavior are a thoroughly bad game to get into;
the ongoing maintainance costs are likely to be much larger than you
expect.
______________________________________
Joe Kesselman / IBM Research
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list