1. A computer program product for constructing a representation of a digital document, the digital document having descriptive markup defining a plurality of hierarchical elements, wherein each element except a root element has an ancestor element and wherein each element has a type name and may have a child element, a left sibling element and a right sibling element, and wherein at least one element contains text content, the computer program product comprising: a computer readable medium having computer program logic stored thereon, wherein the computer program logic defines: a parser for providing a sequence of element events in response to detection of elements and text events in response to text content; means, responsive to an element event, for assigning a unique element identifier to the element event; means, responsive to an element event, for constructing the type name for the element event from the descriptive markup defining the element event; and means, responsive to an element event, for constructing an element descriptor, addressable by the element identifier assigned to the element event, wherein the element descriptor stores an indication of the type name and any parent element, first child element, last child element, left sibling element, right sibling element, and text content contained within the element.
1. A computer program product for constructing a representation of a digital document, the digital document having descriptive markup defining a plurality of hierarchical elements, wherein each element except a root element has an ancestor element and wherein each element has a type name and may have a child element, a left sibling element and a right sibling element, and wherein at least one element contains text content, the computer program product comprising: a computer readable medium having computer program logic stored thereon, wherein the computer program logic defines: a parser for providing a sequence of element events in response to detection of elements and text events in response to text content; means, responsive to an element event, for assigning a unique element identifier to the element event; means, responsive to an element event, for constructing the type name for the element event from the descriptive markup defining the element event; and means, responsive to an element event, for constructing an element descriptor, addressable by the element identifier assigned to the element event, wherein the element descriptor stores an indication of the type name and any parent element, first child element, last child element, left sibling element, right sibling element, and text content contained within the element. 5. The computer program product of claim 1, wherein the computer program logic further defines: means for indexing at least the text content of the digital document including means for providing a sequence of word events in response to detection of each word in the text content; means, responsive to a word event, for constructing a record, addressable by an indication of the detected word, and for storing an indication of the element containing the text content containing the detected word, and for storing an indication of a number of occurrences in the element of the detected word.