XML/DOM (pdk.net.xml)
Contains the structures for XML Processing and the W3C Document Object Model (DOM)
DOMException
DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impossible to perform (either for logical reasons, because data is lost, or because the implementation has become unstable). In general, DOM methods return specific error values in ordinary processing situations, such as out-of-bound errors when using NodeList
.
Properties:
code :: pdk.core.Integer
Inherited properties:
message :: pdk.core.String
Superstructures: Exception <- Object <- Any
Node
Is the primary structure for the entire Document Object Model. It represents a single node in the document tree. While all variables implementing the Node
interface expose methods for dealing with children, not all objects implementing the Node
interface may have children. For example, Text
nodes may not have children, and adding children to such nodes results in a DOMException being raised.
Use pdk.flow.xml.XmlNode functions to operate with Node data
Superstructures: Object <- Any
TypeInfo
represents a type referenced from Element or Attr nodes, specified in the schemas associated with the document. The type is a pair of a namespace URI and name properties, and depends on the document's schema.
Use pdk.flow.xml.XmlTypeInfo functions to operate with TypeInfo data
Superstructures: Object <- Any
Document
represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data.
Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a Document
, the Document
is used to create these objects. The Node
objects created have a ownerDocument
attribute which associates them with the Document
within whose context they were created.
Use pdk.flow.xml.XmlDocument functions to operate variables that are of the Document type
Superstructures: Node <- Object <- Any
DocumentFragment
DocumentFragment
is a "lightweight" or "minimal" Document. It is very common to want to be able to extract a portion of a document's tree or to create a new fragment of a document. Imagine implementing a user command like cut or rearranging a document by moving fragments around. It is desirable to have an object which can hold such fragments and it is quite natural to use a Node for this purpose. While it is true that a Document could fulfill this role, a Document can potentially be a heavyweight object. What is really needed for this is a very lightweight object. DocumentFragment
is such an object.
Superstructures: Node <- Object <- Any
DOMConfiguration
represents the configuration of a document and maintains a table of recognized parameters. Using the configuration, it is possible to change XmlDocument.normalizeDocument behavior, such as replacing the CDATASection nodes with Text
nodes or specifying the type of the schema that must be used when the validation of the Document is requested.
Use pdk.flow.xml.XmlDOMConfiguration functions to operate variables that are of the DOMConfiguration type
Superstructures: Node <- Object <- Any
DOMImplementation
represents DOM implementation of the Document.
Use pdk.flow.xml.XmlDOMImplementation functions to operate variables that are of the DOMConfiguration type
Superstructures: Object <- Any
DocumentType
Each Document has a doctype
attribute whose value is either null
or a DocumentType object. The DocumentType in the DOM Core provides an access to the list of entities that are defined for the document, and little else because the effect of namespaces and the various XML schema efforts on DTD representation are not clearly understood as of this writing.
Use pdk.flow.xml.XmlDocumentType functions to operate variables that are of the DocumentType type
Superstructures: Node <- Object <- Any
ProcessingInstruction
represents a "processing instruction", used in XML as a way to keep processor-specific information in the text of the document.
Use pdk.flow.xml.XmlProcessingInstruction functions to operate variables that are of the ProcessingInstruction type
Superstructures: Node <- Object <- Any
Element
represents an element in an HTML or XML document. Elements may have attributes associated with them; since the Element
inherits from Node, the generic Node structure attribute attributes
may be used to retrieve the set of all attributes for an element.
Use pdk.flow.xml.XmlElement functions to operate variables that are of the Element type
Superstructures: Node <- Object <- Any
Attr
Attr structure extends the Node structure, but since attributes are not actually child nodes of the element they describe, the DOM does not consider them part of the document tree. Thus, the Node
data for attributes parentNode
, previousSibling
, and nextSibling
have a null
value for Attr.
The DOM takes the view that attributes are properties of elements rather than having a separate identity from the elements they are associated with; this should make it more efficient to implement such features as default attributes associated with all elements of a given type. Furthermore, Attr nodes may not be immediate children of a DocumentFragment. However, they can be associated with Element nodes contained within a DocumentFragment. In short, users and implementors of the DOM need to be aware that Attr nodes have some things in common with other objects inheriting the Node structure, but they also are quite distinct.
Use pdk.flow.xml.XmlAttr functions to operate variables that are of the Attr type
Superstructures: Node <- Object <- Any
CharacterData
extends Node structure with a set of attributes for accessing character data in the DOM. No DOM objects correspond directly to CharacterData, though Text
and others do inherit the interface from it.
Text strings in the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In the following, the term 16-bit units is used whenever necessary to indicate that indexing on CharacterData is done in 16-bit units.
Use pdk.flow.xml.XmlCharacterData functions to operate variables that are of the CharacterData type
Superstructures: Node <- Object <- Any
Text
inherits from CharacterData and represents the textual content (termed character data in XML) of an Element or Attr.
Use pdk.flow.xml.XmlText functions to operate variables that are of the Text type
Superstructures: CharacterData <- Node <- Object <- Any
CDATASection
CDATA sections are used to escape blocks of text containing characters that would otherwise be regarded as markup. The only delimiter that is recognized in a CDATA section is the "]]>" string that ends the CDATA section. CDATA sections cannot be nested. Their primary purpose is for including material such as XML fragments, without needing to escape all the delimiters.
Superstructures: Text <- CharacterData <- Node <- Object <- Any
Comment
inherits from CharacterData and represents the content of a comment, i.e., all the characters between the starting '<!--
' and ending '-->
'. Note that this is the definition of a comment in XML, and, in practice, HTML, although some HTML tools may implement the full SGML comment structure.
Superstructures: CharacterData <- Node <- Object <- Any
EntityReference
EntityReference nodes may be used to represent an entity reference in the tree. Note that character references and references to predefined entities are considered to be expanded by the HTML or XML processor so that characters are represented by their Unicode equivalent rather than by an entity reference. Moreover, the XML processor may completely expand references to entities while building the Document, instead of providing EntityReference nodes. If it does provide such nodes, then for an EntityReference node that represents a reference to a known entity an Entity
exists, and the subtree of the EntityReference node is a copy of the Entity
node subtree. However, the latter may not be true when an entity contains an unbound namespace prefix. In such a case, because the namespace prefix resolution depends on where the entity reference is, the descendants of the EntityReference node may be bound to different namespace URIs. When an EntityReference node represents a reference to an unknown entity, the node has no children and its replacement value, when used by XmlAttr.getValue(attr) for example, is empty.
Superstructures: Node <- Object <- Any
NamedNodeMap
used to represent collections of nodes that can be accessed by name. NamedNodeMaps are not maintained in any particular order. Entities contained in an NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, and does not imply that the DOM specifies an order to these Nodes.
Use pdk.flow.xml.XmlNamedNodeMap functions to operate variables that are of the NamedNodeMap type
Superstructures: Object <- Any
Last updated