org.xerial.mlpress
Class TagStructureEncoder
java.lang.Object
org.xerial.mlpress.TagStructureEncoder
public class TagStructureEncoder
- extends Object
The TagStructureEncoder repraces tag structures in XML documents to shorter representations by using
tagIDs.
For example, consider the following XML document:
helloworld.txt
2005/07/24
UTF-8
...
world.png
.....
It will be encoded as follows:
1 2 3 C3 / 4 C4 / 5 6 C6 / 7 C7 / / / 2 8 C8 3 C3 / 9 C9 / 10 C10 / / / $
where the above integers denote IDs of the start tag names. '/' is end tag,
C? (? is an integer) is text container ID, and '$' is the end-of-file.
To distinguish IDs of tag names and attribute names is the role of TagDictionary,
Thus the TagStructureEncoder simply encodes attribute elements,
- Author:
- leo
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TagStructureEncoder
public TagStructureEncoder(TagDictionary tagDict)
encodeTag
public VariableLengthInteger encodeTag(String tagName)
encodeWhiteSpace
public VariableLengthInteger encodeWhiteSpace()
closeTag
public VariableLengthInteger closeTag()
encodeAttribute
public VariableLengthInteger encodeAttribute(String tagName,
String attributeName)

This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.