You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Alan LaViolette <al...@sensor.com> on 2003/01/15 21:22:40 UTC

Xerces Bridge Question

Hello,
I plan on using a DOM tree that is generated on the fly from internal 
data. meaning that in the beginning the DOM will consist of only a 
DocumentNode that knows how to get a list of children it has and 
generate ElementNodes from this data.  My question is.  Will xalan 
function correctly with this setup.  The specifics I would like to know are.

1.  I am going to base my dynamic DOM off the DOM classes from xerces. 
Will the xerces bridge classes cause any problems? Will they process all 
nodes in the xerces tree completely negating my dynamic generation.

2.  Will xalan processing work correctly with a dynamic on the fly tree.

3.  Will xalan try to look at all nodes in a tree to process a xsl?  I 
understand that some xsl could cause this effect but I am interested to 
know if a correctly written xsl will only look at parts of the DOM I am 
interested in.

FYI: I am looking at a dynamic generation technique because our internal 
data set is very large and complex.  From my tests this takes too long 
to convert to XML.

-- 
Alan LaViolette
Software Engineer
Sensor Systems, Inc.
mailto:alan.laviolette@sensor.com



Re: Xerces Bridge Question

Posted by David N Bertoni/Cambridge/IBM <da...@us.ibm.com>.



Hi Alan,

Hopefully, this will help:

   1. Make sure you create the bridge correctly.  Look at the documentation
   for XercesParserLiason::createDocument().  Make sure you set the
   threadSafe parameter to false, and the buildBridge parameter to false.
   Initially, the bridge will only visit the document node and the
   DocumentType node, if there is one.

   2. Yes, but expect significant performance penalties.  Especially severe
   will be expressions with unions (since nodes must be ordered properly)
   or expression with "//" in them.  Also, make sure you are only using DOM
   nodes that are represented in the XPath data model.  For example, avoid
   Entity, CDATASection and EntityReference nodes.  There will also be some
   edge cases, such as the order of Namespace nodes and Attribute nodes
   which may be broken.

   3. Xalan will only visit the nodes necessary to process your XPath
   expressions and match patterns.  So, you should avoid expressions with
   "//" anywhere in them, and avoid overly-complex match patterns which
   force Xalan to look forward in the tree.  Things to avoid:

      Axes

         following
         descendant
         descendant-or-self
         preceding

      Other

         the count() function
         the position() function
         positional predicates (foo[1])

Dave



                                                                                                                                
                      Alan LaViolette                                                                                           
                      <alan.laviolette@         To:      xalan-c-users@xml.apache.org                                           
                      sensor.com>               cc:      (bcc: David N Bertoni/Cambridge/IBM)                                   
                                                Subject: Xerces Bridge Question                                                 
                      01/15/2003 12:22                                                                                          
                      PM                                                                                                        
                                                                                                                                




Hello,
I plan on using a DOM tree that is generated on the fly from internal
data. meaning that in the beginning the DOM will consist of only a
DocumentNode that knows how to get a list of children it has and
generate ElementNodes from this data.  My question is.  Will xalan
function correctly with this setup.  The specifics I would like to know
are.

1.  I am going to base my dynamic DOM off the DOM classes from xerces.
Will the xerces bridge classes cause any problems? Will they process all
nodes in the xerces tree completely negating my dynamic generation.

2.  Will xalan processing work correctly with a dynamic on the fly tree.

3.  Will xalan try to look at all nodes in a tree to process a xsl?  I
understand that some xsl could cause this effect but I am interested to
know if a correctly written xsl will only look at parts of the DOM I am
interested in.

FYI: I am looking at a dynamic generation technique because our internal
data set is very large and complex.  From my tests this takes too long
to convert to XML.

--
Alan LaViolette
Software Engineer
Sensor Systems, Inc.
mailto:alan.laviolette@sensor.com