- Inherits from:
- Object
- Declared in:
- DXML.h
Object
|
+---DXMLReader
Class Description
The DXMLReader class implements methods for parsing a xml file. The class
uses expat for the low level parsing. The parsing of DTDs and External
Entities are not supported. The method 'characters' returns the exact
contents between the start elements and end element, including linefeed
and indent spacing. The method 'unparsed' returns everything that could
not be parsed, including DTDs and External Entities References. Use a character
that can't be part of an URI e.g. '|' for the namespace separator.
- Last modified:
- 23-Jul-2006 (DXML.h)
Instance Variables
- private id <DXMLHandler> _handler
- the reference to the xml handler
- private int _bufferSize
- the size of the buffer (def. 8192)
- private XML_Parser _parser
- the xml parser
- private DText *_name
- the name of the source
- private DXMLChar _separator
- the namespace separator (def. \0 = no namespace)
- private DXMLChar *_encoding
- the encoding to be used (def. NULL = from xml file)
- private DText *_characters
- the characters buffer
- private DText *_unparsed
- the unparsed buffer
- Constructors
- - (DXMLReader *) init
- Initialise a xml reader
- Returns:
- the object
- Copy constructor
- - shallowCopy
- Do a shallow copy of the object (not implemented)
- Returns:
- the object
- Deconstructor
- - free
- Free the object
- Returns:
- the object
- Member methods
- - (int) bufferSize
- Get the buffer size for the parser
- Returns:
- the size
- - (DXMLReader *) bufferSize :(int) size
- Set the buffer size for the parser
- Parameters:
- size - the buffer size
- Returns:
- the object
- - (const DXMLChar *) encoding
- Get the encoding used for the xml documents
- Returns:
- the encoding overrider (or NULL)
- - (DXMLReader *) encoding :(const DXMLChar *) encoding
- Set the encoding overrider
- Parameters:
- encoding - the encoding to be used
- Returns:
- the object
- Parser methods
- + (const char *) errorToString :(int) error
- Translate the error to a text string
- Parameters:
- error - the error number
- Returns:
- the text string
- - (int) columnNumber
- Return the current column number during parsing
- Returns:
- the current column number
- - (int) lineNumber
- Return the current line number during parsing
- Returns:
- the current line number (or 0)
- - (const char *) name
- Return the name of the source during parsing
- Returns:
- the current source name
- - (BOOL) parse :(id <DTextReadable>) source :(const char *) name :(id <DXMLHandler>) handler :(DXMLChar) separator
- Parse a XML file
- Parameters:
- source - the source of the xml file
name - the name of the xml file
handler - the xml handler
separator - the namespace separator
- Returns:
- success
generated 25-Jul-2006 by ObjcDoc 3.0.0