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.64 date: 2024/03/07 07:46:58
user: cg
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> 


Class protocol:

inspecting
o  inspector2XMLDOMTabTreeFor: anObject

queries
o  isAbstract
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.


Instance protocol:

Twoflower
o  isHTMLBodyElement

accessing
o  attributeNamed: attributeName
##add MU 11/7/2000 13:38

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  parents

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
depth should be named indent

o  prettyPrintOn: aStream
depth should be named indent

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 must be redefined in concrete classes (subclassResponsibility) **

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

** This method must be redefined in concrete classes (subclassResponsibility) **

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 must be redefined in concrete classes (subclassResponsibility) **

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
return the first xPath which uniquely refers to this node.
Going to be obsoleted by xPathAndAlternativesInto:

o  xPathAndAlternativesInto: aBlock
generates the preferred xPath as return value,
in addition enumerates this xPath and alternative xPathes into aBlock:
- unique attributes among siblings
- index
Useful to offer alternative xpathes in a GUI (eg. in the XML inspector)

o  xPathAndUpTo: limitOrNil alternativesInto: aBlock
generates the preferred xPath as return value,
in addition enumerates this xPath and alternative xPathes into aBlock:
- unique attributes among siblings
- index
limitOrNil controls the max. number of Xpathes to be generated
(do avoid enormous combinatoric explosion)
Useful to offer alternative xpathes in a GUI (eg. in the XML inspector);
if nil, all of them are enumerated

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 17:16:15 GMT