eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'XMLStandardDecoder':

Home

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

Class: XMLStandardDecoder


Inheritance:

   Object
   |
   +--XML::SAXDriver
      |
      +--XMLStandardDecoder

Package:
stx:goodies/xml/stx
Category:
XML-Presentation
Version:
rev: 1.45 date: 2024-04-30 15:41:41
user: stefan
file: XMLStandardDecoder.st directory: goodies/xml/stx
module: stx stc-classLibrary: stx

Description:


XMLStandardDecoder is used to decode the XML representation of objects encoded
with XMLStandardCoder


[instance variables:]
    idToObjectMapping   <Collection> Mapping from object ids to objects
    object              <Object>     The decoded object
    aspect              <String|nil> The aspect used to encode
    version             <String|nil> The version provided by the encoder
    stack               <Stack>      Stack of nested objects
    characterStream     <WriteStream>Stream to collect character data
    needWhitespace      <Bool>       true, when whitespace should be preserved for the
                                     current element
    useSend             <Bool>       If true, use #perform: instead of
                                     #instvarNamed:put: to build objects


[class variables:]

copyright

COPYRIGHT (c) 2004 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

instance creation
o  on: readStream
redefine to switch off validation

o  on: readStream beforeScanDo: aBlock
redefine to switch off validation


Instance protocol:

accessing
o  aspect
return the value of the instance variable 'aspect' (automatically generated)

o  next
answer the next object from the stream.
Notice: VALID xml files contain only a single object.

o  object

o  useSend

o  useSend: aBoolean
if aBoolean is true, the decoder uses a message send to set the values of an object.
If aBoolean is false, the instance variables are set directly

o  version
return the value of the instance variable 'version' (automatically generated)

building
o  add: newObj toParent: parentObjectContainer with: currentObjectContainer
add an object to its parent object

o  remember: obj as: id
map an object id to an object.
We know here that object ids are consecutive integers starting at 1.
If this changes, we have to use a Dictionary instead of an OrderedCollection

o  valueForElementName: elementName class: classNameGiven size: sizeGiven
answer an object for a XML element name.
Only some primitive elements or containers may be resolved immediately.
Others need the elements text available only when the end tag is
being processed. In this case push a converter onto the stack and return 0

content handler
o  characters: aString
process xml character data.
If characters are separated by ignorable whitespace, this may
be called more than once for a single element

o  endElement: localName namespace: nameSpace prefix: nameSpacePrefix
end of xml element.
If stack is empty, this is the single top element.
Otherwise this is a subordinate element, that will be added
to its containing object

o  ignorableWhitespace: aString
got white space. We need all white space in strings and symbols

o  startDocument
(comment from inherited method)
Indicates the start of a document

o  startElement: localName namespace: namespace prefix: nameSpacePrefix attributes: attributes
aspect may be present only in the start element

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


Private classes:

    AbstractConverter
    Base64Converter
    CharacterConverter
    ContainedObject
    ContainedSequence
    NumberConverter
    StringConverter
    SymbolConverter

Examples:


Look at examples in XMLStandardCoder


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 16:34:19 GMT