You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by Ke...@bredex.com on 2002/05/14 17:55:39 UTC

RE: XML serializing [TraxUtility Code]

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"                                                                                                               
                    <james.bates@amp       To:     <xi...@xml.apache.org>                                                                 
                    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:andsh@node.lt]
> Sent: 14 May 2002 11:01
> To: xindice-dev@xml.apache.org
> 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
>
>
>