Carapace

XmlParser Class

The XmlParser allows XML data to be parsed to or from a Stream. Since streams can be attached to files, strings or communications channels, this provides a powerful method for dealing with XML data.

See the related Xml class for further information about XML processing within Carapace.

XmlParser Creation

Defined within the script xml.cpl, the create function is used to create an XmlParser object:

    (create XmlParser)
Once created, the object is manipulated via its properties and methods.

XmlParser Properties

property name property type description
inStrm Stream the input stream
outStrm Stream the output stream

XmlParser Methods

method name description
readFromString read from the supplied string
parseStream parse the entire input stream
writeToStream write the supplied Xml object to the output stream
parseObject parse a single object where the first character on the stream is the > or optional whitespace

readFromString

Read from the supplied string -- this simply sets the input stream to read from the string.

Arguments:

textString

Return type: the empty List ()


parseStream

Parse the entire input stream -- the List of parsed Xml objects is returned.

Arguments: none

Return type: List


parseObject

Parse a single object where the first character on the stream is the > or optional whitespace.

Arguments: none

Return type: Object


writeToStream

write the supplied Xml object to the output stream.

Arguments:

objObject

Return type: List


Contents Index Current topic: objects Related links: built-in objects