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 jb...@apache.org on 2002/12/04 17:24:45 UTC
cvs commit: xml-xindice/src/documentation/resources/images attribute.png attribute.xcf document.png document.xcf text.png text.xcf
jbates 2002/12/04 08:24:44
Modified: src/documentation/content/xdocs/dev guide-internals.xml
Added: src/documentation/resources/images attribute.png
attribute.xcf document.png document.xcf text.png
text.xcf
Log:
More Compressed DOM information
Revision Changes Path
1.5 +55 -2 xml-xindice/src/documentation/content/xdocs/dev/guide-internals.xml
Index: guide-internals.xml
===================================================================
RCS file: /home/cvs/xml-xindice/src/documentation/content/xdocs/dev/guide-internals.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- guide-internals.xml 3 Dec 2002 15:26:07 -0000 1.4
+++ guide-internals.xml 4 Dec 2002 16:24:43 -0000 1.5
@@ -447,6 +447,16 @@
is located in the <code>org.apache.xindice.xml.dom.DOMCompressor</code> class.</p>
<section>
<title>4.2.1. Document node</title>
+ <p>The document node, which can at most contain some processing intructions,
+ comments, and exactly one element, is encoded as follows:</p>
+ <figure src="images/document.png" alt="Document node compressed DOM format"/>
+ <p>The 4-byte <code>record_length</code> field, which is always encoded in Big Endian order,
+ i.e. the most significamt byte at the lowest address, indicates the total length,
+ in bytes, of the encoded document byte array, <em>excluding</em> the 4 bytes
+ used by <code>record_length</code>.</p>
+ <p>The child data is formed by concatenating the byte arrays generated by the processing
+ instruction, comment and element nodes inside the document, in the order they appear
+ in the document.</p>
</section>
<section>
<title>4.2.2. Element nodes</title>
@@ -501,7 +511,7 @@
field, the <code>symbol_id</code> field and any child & attribute data.
</li>
<li><code>symbol_id</code> (2 bytes): This is the 16-bit identifier that is associated with the
- element <em>name</em> of this element in the containing collection's symbol table.
+ element <em>name</em> (QName and namespace URI) of this element in the containing collection's symbol table.
</li>
<li><code>attribute_count</code> (<code>y</code>: number of
bytes indicated by <code>ACT</code> code in signature): the number of attributes
@@ -519,9 +529,52 @@
</section>
<section>
<title>4.2.3. Attribute nodes</title>
+ <p>An attribute node is encoded as follows:</p>
+ <figure src="images/attribute.png" alt="Attribute compressed DOM format"/>
+ <p>Once again, both 2-byte fields are Big Endian.</p>
+ <ul>
+ <li>The <code>symbol_id</code> (2 bytes) is the identifier that is associated with the
+ attribute <em>name</em> (QName and namespace URI) of this attribute in the
+ containing collection's symbol table.
+ </li>
+ <li>The <code>length</code> (2 bytes) is the length, in bytes of the <code>data</code> field
+ that follows. Note the length of <code>length</code> is fixed at 2 bytes, so an
+ attribute's data can be at most 65536 bytes long.
+ </li>
+ <li>The <code>data</code> is the byte array obtained by encoding the character data that
+ is the attribute value in UTF-8. Note that the number of bytes will in general be more
+ than the number of characers encoded by them, as UTF-8 is a variable character-width
+ encoding scheme.
+ </li>
+ </ul>
</section>
<section>
<title>4.2.4. Text nodes</title>
+ <p>A text node is encoded as follows:</p>
+ <figure src="images/text.png" alt="Text node compressed DOM format"/>
+ <p>The meaning of the various fields is as follows:</p>
+ <ul>
+ <li><code>signature</code> (1 byte): is composed of several bit fields
+ as follows:
+ <ul>
+ <li>bits 0-1: unused, and always set to <code>00</code></li>
+ <li>Record Length Type (bits 2-3): used to indicate
+ the length of the <code>rec_length</code> field exactly
+ as for elements.</li>
+ <li>bits 4-5: unused, and always set to <code>00</code></li>
+ <li>signature type (bits 6-7): for text nodes, these are
+ set to <code>00</code>. These allow Xindice to know that the
+ encoded node is a text node.</li>
+ </ul>
+ </li>
+ <li><code>record_length</code> (x: as indicated in <code>RTL</code>): length
+ of the complete byte array for this text node, <em>including</em> the signature
+ and this <code>record_length</code> field. As this field could be 4 bytes long,
+ there is not the same restriction on text node length as there is on attribute
+ length.</li>
+ <li><code>data</code>: This is the byte array obtained by encoding the character data
+ of the text node in UTF-8.</li>
+ </ul>
</section>
<section>
<title>4.2.5. Comment nodes</title>
1.1 xml-xindice/src/documentation/resources/images/attribute.png
<<Binary file>>
1.1 xml-xindice/src/documentation/resources/images/attribute.xcf
<<Binary file>>
1.1 xml-xindice/src/documentation/resources/images/document.png
<<Binary file>>
1.1 xml-xindice/src/documentation/resources/images/document.xcf
<<Binary file>>
1.1 xml-xindice/src/documentation/resources/images/text.png
<<Binary file>>
1.1 xml-xindice/src/documentation/resources/images/text.xcf
<<Binary file>>