I have discovered and reported issues with Xalan/JAXP (though I believe it is more of a spec mismatch issue). The code I attached earlier attempts to circumvent this issue when possible by using StreamSource instead of DOMSource. I hope this helps...
DOMResult and StreamResult differ on adding DOCTYPE: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7249 Kevin Ross www.bredex.com [EMAIL PROTECTED] dex.com To: [EMAIL PROTECTED] cc: 05/14/2002 Subject: RE: XML serializing [TraxUtility Code] 10:55 AM Please respond to xindice-dev Here is a piece of code I make tremendous use of. It has worked quite well for me, and if nothing else should be a good example to get you started... (See attached file: TraxUtility.java)(See attached file: TraxUtilityTest.java) (See attached file: TransformationException.java)(See attached file: NestedException.java) I believe the TransformationException is the only legacy class in the codebase, which you can do with as you please should you choose to reuse this code. Kevin Ross "James Bates" <[EMAIL PROTECTED] To: <[EMAIL PROTECTED]> lexor.com> cc: Subject: RE: XML serializing 05/14/2002 04:35 AM Please respond to xindice-dev Ahh.. I thought someone might suggest that. I know Cocoon does things that way. There's a problem: Xalan doesn't do what it should with namespaces and this way of serializing fails in namespace-intensive documents because of that. The Xerces serializer seems to work better (Although if it's the same one, how can this be?) So I'm rather reluctant to use that trick... James > -----Original Message----- > From: Andrius Sabanas [mailto:[EMAIL PROTECTED] > Sent: 14 May 2002 11:01 > To: [EMAIL PROTECTED] > Subject: Re: XML serializing > > > James Bates wrote: > > I couldn't find any serialization in JAXP... Where is it? > (That would obviously be better; I agree) > > > Hi, > > Serialization in JAXP is done in some strange way - you need to > transform your Source into StreamResult using null transformer, > transformerFactory.newTransformer().transform(source, stream) > > HTH, > > > Andrius > > > (See attached file: TraxUtility.java)(See attached file: TraxUtilityTest.java)(See attached file: TransformationException.java)(See attached file: NestedException.java)
TraxUtility.java
Description: Binary data
TraxUtilityTest.java
Description: Binary data
TransformationException.java
Description: Binary data
NestedException.java
Description: Binary data
