eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'XML::Document':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Document (in XML)


Inheritance:

   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

Description:


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>  


Class protocol:

instance creation
o  new
(comment from inherited method)
return an instance of myself without indexed variables


Instance protocol:

IDs
o  atID: key ifAbsent: aBlock

o  registerID: attribute from: aParser

o  updateIDs

accessing
o  / elementName
XPath like access to the root element

o  // elementName
XPath like access to all subelements named elementName

o  addNamespaceDefinitions

o  addNode: aNode

o  document

o  dtd

o  dtd: aDTD

o  elements

o  pathName

o  root

o  selectNodes: aBlock

o  xmlVersion

o  xmlVersion: aString

comparing
o  = 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.

o  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
o  cloneTree
answer a copy of the tree, so that removal of child elements
from the copy does not affect the original node.

enumerating
o  nodesDo: aBlock
evaluate aBlock for me and all element nodes

o  nodesReverseDo: aBlock
evaluate aBlock for me and then recurively or children in reverse order

o  treePosition
answer a SequencableCollection which holds the position of the node
in the document tree

flags
o  hasDTD

o  hasExternalDTD

o  noteDTD

o  noteExternalDTD

o  notePEReference

o  usesParameterEntities

initialization
o  initialize
(comment from inherited method)
just to ignore initialize to objects which do not need it

printing
o  prettyPrintOn: aStream
(comment from inherited method)
depth should be named indent

o  printCanonicalOn: aStream
no version header in canonical XML;

o  printHTMLOn: aStream
(comment from inherited method)
Print myself on the stream in a form usual for HTML.

o  printHeaderOn: aStream

o  printNoIndentOn: aStream endSpacing: endSpacingBlock spacing: spacingBlock
(comment from inherited method)
Print myself on the stream with line breaks between adjacent
elements, but no indentation.

o  printOn: aStream
(comment from inherited method)
self printAsOneLineOn: aStream

private helpers
o  treePositionOf: aNode
return a collection containing the position of the node in the document

testing
o  hasSubNodes

o  isContent

o  isDocument

o  verifyContents

visiting
o  acceptVisitor: aVisitor
Double dispatch back to the visitor, passing my type encoded in
the selector (visitor pattern)



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 17:09:05 GMT