Thanks.  I went with James Clark's code.  Once I taught it to use namespaces it worked just fine for me.


----- Original Message ----
From: Michael Kay <mike@saxonica.com>
To: Mailing list for SAXON XSLT queries <saxon-help@lists.sourceforge.net>
Sent: Friday, September 29, 2006 2:30:20 PM
Subject: Re: [saxon] Attribute Order

Well, you could put Saxon's output through an XML canonicalizer: some of my test suites use a canonicalizer produced years ago by James Clark. Or you could tweak the Saxon serializer. With the new features in 8.8 this shouldn't be too hard:
* create a subclass of XMLEmitter in which you intercept the calls on attribute() and namespace() and startContent() to buffer the attributes and sort them
* subclass SerializerFactory, overriding the newXMLEmitter() method to instantiate your subclass of XMLEmitter
* register this subclass of SerializerFactory with the Configuration object
Michael Kay

From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Martin Wegner
Sent: 29 September 2006 19:54
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Attribute Order

Whenever I see someone write into this list about having trouble with the order of attributes in a serialized XML message, I always laugh.  But now I am laughing at myself.  I have found myself in the difficult spot where I need two different machines, with the same JARs, JRE and classpath, to produce the same sequence of bytes for a given DOM.  Is there any solution to this aside from writing my own serializer?

And yes, you can start laughing.


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
saxon-help mailing list