|
Class: Document (in XML)
Object
|
+--XML::Node
|
+--XML::Document
|
+--XML::DocumentFragment
- Package:
- stx:goodies/xml/vw
- Category:
- XML-VW-Nodes
- Version:
- rev:
1.23
date: 2023/10/06 19:38:28
- user: stefan
- file: Document.st directory: goodies/xml/vw
- module: stx stc-classLibrary: vw
This class represents an XML document entity and serves as the root of the document entity tree. Each XML document has one entity (root) called the document entity, which serves as the starting point for the XML processor and may contain the whole document (nodes collection).
According to the XML 1.0 specification, XML documents may and should begin with an XML declaration which specifies the version of XML (xmlVersion instance variable) being used.
The XML document type declaration which must appear before the first element in a document contains or points to markup declarations that provide the grammar for this document. This grammar is known as document type definition (dtd instance variable). An XML document is valid if it has an associated document type declaration and if the document complies with the constraints expressed in it. If the document type declaration is not present, the document can be at most well formed.
Instance Variables:
root <XML.Node>
nodes <Collection>
xmlVersion <String>
Version of the XML specification to which the document is conformant
dtd <XML.DocumentType>
Associated document type definition
ids <Dictionary>
instance creation
-
new
-
(comment from inherited method)
return an instance of myself without indexed variables
IDs
-
atID: key ifAbsent: aBlock
-
-
registerID: attribute from: aParser
-
-
updateIDs
-
accessing
-
/ elementName
-
XPath like access to the root element
-
// elementName
-
XPath like access to all subelements named elementName
-
addNamespaceDefinitions
-
-
addNode: aNode
-
-
document
-
-
dtd
-
-
dtd: aDTD
-
-
elements
-
-
pathName
-
-
root
-
-
selectNodes: aBlock
-
-
xmlVersion
-
-
xmlVersion: aString
-
comparing
-
= anXmlDocument
-
(comment from inherited method)
return true if the receiver and the arg have the same structure.
Notice:
This method is partially open coded (inlined) by the compiler(s)
identical objects are always considered equal.
redefining it may not work as expected.
-
hash
-
(comment from inherited method)
return an Integer useful as a hash key for the receiver.
This hash should return same values for objects with same
contents (i.e. use this to hash on structure)
copying
-
cloneTree
-
answer a copy of the tree, so that removal of child elements
from the copy does not affect the original node.
enumerating
-
nodesDo: aBlock
-
evaluate aBlock for me and all element nodes
-
nodesReverseDo: aBlock
-
evaluate aBlock for me and then recurively or children in reverse order
-
treePosition
-
answer a SequencableCollection which holds the position of the node
in the document tree
flags
-
hasDTD
-
-
hasExternalDTD
-
-
noteDTD
-
-
noteExternalDTD
-
-
notePEReference
-
-
usesParameterEntities
-
initialization
-
initialize
-
(comment from inherited method)
just to ignore initialize to objects which do not need it
printing
-
prettyPrintOn: aStream
-
(comment from inherited method)
depth should be named indent
-
printCanonicalOn: aStream
-
no version header in canonical XML;
-
printHTMLOn: aStream
-
(comment from inherited method)
Print myself on the stream in a form usual for HTML.
-
printHeaderOn: aStream
-
-
printNoIndentOn: aStream endSpacing: endSpacingBlock spacing: spacingBlock
-
(comment from inherited method)
Print myself on the stream with line breaks between adjacent
elements, but no indentation.
-
printOn: aStream
-
(comment from inherited method)
self printAsOneLineOn: aStream
private helpers
-
treePositionOf: aNode
-
return a collection containing the position of the node in the document
testing
-
hasSubNodes
-
-
isContent
-
-
isDocument
-
-
verifyContents
-
visiting
-
acceptVisitor: aVisitor
-
Double dispatch back to the visitor, passing my type encoded in
the selector (visitor pattern)
|