eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'XML::Node':

Home

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

Class: Node (in XML)


Inheritance:

   Object
   |
   +--XML::Node
      |
      +--XML::Attribute
      |
      +--XML::Comment
      |
      +--XML::Document
      |
      +--XML::Element
      |
      +--XML::Entity
      |
      +--XML::Notation
      |
      +--XML::PI
      |
      +--XML::Text

Package:
stx:goodies/xml/vw
Category:
XML-VW-Nodes
Version:
rev: 1.49 date: 2019/08/06 17:10:09
user: stefan
file: Node.st directory: goodies/xml/vw
module: stx stc-classLibrary: vw

Description:


An XML.Node represents a logical component of an XML Document. Logically, the
document is composed of declarations, elements, comments, character references, and 
processing instructions, all of which are indicated in the document by explicit markup. 
The various subclasses of XML.Node represent these various components.

Subclasses must implement the following messages:
        printing
                printCanonicalOn:
                printHTMLOn:
                printNoIndentOn:endSpacing:spacing:

Instance Variables:
        parent  <XML.Node | nil> 
        flags   <SmallInteger> 


Instance protocol:

Twoflower
o  isHTMLBodyElement

accessing
o  attributes

o  children
Visualworks uses the method #children to do essentially the same as elements.
I suppose children may be the better name.

o  discard
speed up common cases

o  document

o  elements
Visualworks uses the method #children to do essentially the same as this. Does not do much though

o  expandedName

o  flags

o  flags: flagBits

o  parent

o  parent: aNode

o  pathName
answer the path name of this node

o  selectNodes: aBlock

o  tag

o  unDiscard
clear the discard flag

copy
o  cloneTree
answer a copy of the tree, so that removal of child elements
from the copy does not affect the original node.

Make a shallowCopy to protect the parent

enumerating
o  elementsDo: aBlock
intentionally left blank

o  nodesDo: aBlock

o  nodesReverseDo: aBlock

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

inspecting
o  inspector2TabTree
extra tab to be shown in an inspector2.

o  inspectorExtraAttributes
extra (pseudo instvar) entries to be shown in an inspector.

namespaces
o  findNamespaceAt: qualifier

o  findQualifierAtNamespace: ns

o  namespaceAt: qualifier

o  qualifierAtNamespace: ns

printing & storing
o  canonCharacterTable
http:www.w3.org/TR/2001/REC-xml-c14n-20010315#Page.10 (Attribute nodes)

o  canonicalPrintString

o  displayOn: aGCOrStream
what a kludge - Dolphin and Squeak mean: printOn: a stream;

o  noIndentPrintString

o  prettyPrintColorizedOn: aStream

o  prettyPrintColorizedOn: aStream depth: indent

o  prettyPrintOn: aStream

o  prettyPrintOn: aStream depth: indent
self subclassResponsibility

o  printCanonical: text on: aStream
Print myself on the stream in the form described by
James Clark's canonical XML.

o  printCanonical: text withEscapedLineFeeds: withEscapedLineFeeds on: aStream
Print myself on the stream in the form described by
James Clark's canonical XML.

o  printCanonicalOn: aStream
Print myself on the stream in the form described by James
Clark's canonical XML.

** This method raises an error - it must be redefined in concrete classes **

o  printHTMLOn: aStream
Print myself on the stream in a form usual for HTML.

** This method raises an error - it must be redefined in concrete classes **

o  printNoIndentOn: aStream
Print myself on the stream with line breaks between adjacent
elements, but no indentation.

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

** This method raises an error - it must be redefined in concrete classes **

o  printOn: aStream
self printAsOneLineOn: aStream

o  simpleDescription

o  storeOn: aStream
blocked: ascii storeString not possible (recursive - element - children - parent)

queries
o  hasAncestor: aNode

o  hasSubNodes

o  precedes: aNode

o  xPath
I am not sure if this position counter *should*
really start at 1 or at 0.
cg: yes, they do start at 0!

testing
o  isAttribute

o  isBlankText

o  isComment

o  isContent

o  isDiscarded

o  isDocument

o  isElement

o  isEntity

o  isLike: aNode

o  isProcessingInstruction

o  isText

o  isYAXODomNode

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; Fri, 13 Dec 2019 15:38:42 GMT