org.xwt.util
Class XML.Element

java.lang.Object
  extended byorg.xwt.util.XML.Element
Enclosing class:
XML

public static final class XML.Element
extends java.lang.Object

Used as a struct for holding information about a current element, and acts as a linked list entry.

Each element stores a hashtable of namespace definitions against their respective prefix, and a variable holding their default uri. If they did not specify a default uri, their parent's uri is copied in to keep up the sembelence of speedy parsing.

SLOWEST PART OF THE XML PARSER

To implement the Namespace Specification exactly, we have to store prefix mappings for elements away from its parents and siblings. This means if a child of a child of-a child uses a prefix defined in the root, we have to search each Hashtable in each Element until we get to the root.

Unfortunetally, every other solution I can think of requires more work than this one, shifted to different parts of the parser.


Field Summary
 java.lang.String defaultUri
          Default URI for this element and its children with no prefix.
 XML.XMLException[] errors
          An array of non-fatal errors related to this element.
 java.lang.String[] keys
          An array of attribute names.
 int len
          Current number of attributes in the keys and vals arrays.
 java.lang.String localName
          LocalPart of current element.
 XML.Element next
           
 java.lang.String prefix
          Prefix of current element.
 XML.Element prev
           
 java.lang.String qName
          Qualified Name of current element.
 java.lang.String uri
          URI of current tag.
 Hash urimap
          A hashtable of all namespace prefixes that are defined by this element.
 java.lang.String[] vals
          An array of attribute values.
 
Constructor Summary
XML.Element()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

next

public XML.Element next

prev

public XML.Element prev

urimap

public Hash urimap
A hashtable of all namespace prefixes that are defined by this element.


keys

public java.lang.String[] keys
An array of attribute names.


vals

public java.lang.String[] vals
An array of attribute values.


errors

public XML.XMLException[] errors
An array of non-fatal errors related to this element.


len

public int len
Current number of attributes in the keys and vals arrays.


defaultUri

public java.lang.String defaultUri
Default URI for this element and its children with no prefix.


uri

public java.lang.String uri
URI of current tag. XML Namespace Spec 14-Jan-1999 section 1


localName

public java.lang.String localName
LocalPart of current element. XML Namespace Spec 14-Jan-1999 [8]


qName

public java.lang.String qName
Qualified Name of current element. XML Namespace Spec 14-Jan-1999 [6]


prefix

public java.lang.String prefix
Prefix of current element. Substring of qName. XML Namespace Spec 14-Jan-1999 [7]

Constructor Detail

XML.Element

public XML.Element()