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
>
>
>


Attachment: TraxUtility.java
Description: Binary data

Attachment: TraxUtilityTest.java
Description: Binary data

Attachment: TransformationException.java
Description: Binary data

Attachment: NestedException.java
Description: Binary data

Reply via email to