dleslie     01/06/14 16:02:56

  Added:       java/xdocs/sources/xalan dtm.xml
  Log:
  DTM topic
  
  Revision  Changes    Path
  1.1                  xml-xalan/java/xdocs/sources/xalan/dtm.xml
  
  Index: dtm.xml
  ===================================================================
  <?xml version="1.0" standalone="no"?>
  
  <!DOCTYPE s1 SYSTEM "../../style/dtd/document.dtd">
  
  <s1 title="&xslt4j; DTM">
  <s2 title="Introduction">
  <p>The Document Table Model (DTM) is an interface that mimics the W3C Document 
Object Model (<resource-ref idref="dom"/>) interface. In place of the DOM object tree 
of nodes, DTM uses integer arrays and string pools to represent the structure and 
content of the XML document to be transformed. The motivation behind this model is to 
optimize performance and minimize storage.</p>
  <p>Specifically, DTM avoids the overhead of instantiating the objects the standard 
DOM requires to represent a tree of nodes. DTM uses unique integer "handles" to 
identify nodes, integer ID values to represent URLs, local names, and expanded names, 
and integer index and length references to a string buffer to represent the text value 
of each node.</p>
  <p>The Xalan DTM implementation also allows the Xalan processor to begin reading the 
DTM and performing the transformation while the DTM is still being assembled (the 
parser is still parsing the XML source).</p>
  </s2>
  <s2 title="DTM performance settings">
  <p>&xslt4j; implements two DTM performance features that you can control with the 
TransformerFactory
  <jump 
href="apidocs/javax/xml/transform/TransformerFactory.html#setAttribute(java.lang.String,
 java.lang.Object)">setAttribute()</jump>
  method.</p>
  <table>
  <tr>
    <th>Attribute ID (URL)</th>
    <th>Default setting</th>
    <th>Description</th>    
  </tr>
  <tr>
    <td>"http://xml.apache.org/xalan/features/incremental";</td>
    <td>false</td>
    <td>incremental transforms</td>
  </tr>
  <tr>
    <td>"http://xml.apache.org/xalan/features/optimize";</td>
    <td>true</td>
    <td>optimized transforms</td>
  </tr>
  </table>
  <s3 title="http://xml.apache.org/xalan/features/incremental";>
   <p>Set this feature to true to enable incremental transformations. If set to false
   (the default), the transform and the parse are performed on the same thread.</p>
   <note> When set to true: If the parser is Xerces, we perform an incremental 
transform on a single thread using the Xerces 
   "parse on demand" feature. If the parser is not Xerces, we run the transform in one 
thread and the parse in another. Exception: if the
   parser is not Xerces and the XML source is a DOMSource, setting this feature to 
true has no effect.</note>
   <p>Example: setting incremental transforms to true:</p>
   <source>javax.xml.transform.TransformerFactory tFactory =
            javax.xml.transform.TransformerFactory.newInstance();
  tFactory.setAttribute
            ("http://xml.apache.org/xalan/features/incremental";, true);
  ...</source>
  </s3>
  <s3 title="http://xml.apache.org/xalan/features/optimize";>
   <p>When set to true (the default), this feature enables optimizations that may 
involve 
   structural rewrites of the stylesheet. Any tool that requires direct access to the 
stylesheet structure should set this feature to 
   false.</p>
  </s3> 
  </s2>
  </s1>
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to