It's almost always better to let Xalan build it's own internal
representation, rather than pass a Xerces DOM instance, which must be
wrapped to be transformed.  For small sources, the overhead is not too bad,
but it's grows quite quickly as the size of the source grows.

If you're building a DOM programmatically, consider using SAX and building
Xalan's internal representation (see the DocumentBuilder sample).  This
works if you aren't really building a DOM then manipulating it, you're just
building it for the transformation.

To summarize -- if you're building the DOM solely for the sake of
transforming, then build Xalan's internal representation using SAX2 events.
If you're starting with a serialized XML document, then just let Xalan
parse the document (using Xerces, of course), and Xalan will handle the
details.  The only way using the Xerces DOM is a win is if you're actually
using the DOM for building _and_ modifying a document.

Dave



                                                                                
                                                      
                      Arun Ramdas                                               
                                                      
                      <[EMAIL PROTECTED]         To:      
[email protected]                                                  
                      com>                     cc:      (bcc: David N 
Bertoni/CAM/Lotus)                                              
                                               Subject: performance question    
                                                      
                      02/01/2002 10:06                                          
                                                      
                      AM                                                        
                                                      
                                                                                
                                                      
                                                                                
                                                      



I am using Xalan-c 1.3 for XSL transformations. I have a dilemma in passing
the input XML document to Xalan transformer whether to use the XML in
complete string format or Xerces-C DOM Node. I believe the DOM node will be
better because the parsing can be avoided in the transformer. Or i am
wrong??

Please send me ur inputs on this.

Thanks
Arun





Reply via email to