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.19 date: 2018/02/15 13:55:34
user: cg
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


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

o  hash

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

o  nodesReverseDo: aBlock

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

printing
o  prettyPrintOn: aStream

o  printCanonicalOn: aStream
no version header in canonical XML;

o  printHTMLOn: aStream

o  printHeaderOn: aStream

o  printNoIndentOn: aStream endSpacing: endSpacingBlock spacing: spacingBlock

o  printOn: 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.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sun, 17 Nov 2019 02:12:46 GMT