- Inherits from:
- Object
- Conforms to:
- DXMLHandler
- Declared in:
- DXML.h
Object
|
+---DXMLWriter
Class Description
The xml writer class implements methods for writing a xml file. This class
does NOT check the correctness of the written xml. The method 'characters'
translates the special characters (<,>,&,",'), the method 'unparsed' does
not. With the last method an entity or character reference can be written.
Linefeeds are never added by the writer. Linefeeds must be supplied by the
calling software by using 'characters:' or 'unparsed:'. 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 <DTextWritable> _dest
- the config file
- private DList *_elements
- the stack with the element names
- private DList *_namespaces
- the stack with the namespaces
- private DList *_unprocessed
- the list with the unprocessed namespaces
- private BOOL _closeElement
- should the last element still be closed ?
- private BOOL _inCData
- is the writer inside a CDATA section ?
- private char _separator
- the namespace separator (or EOS for none)
- Constructors
- - (DXMLWriter *) init
- Initialise a xml writer
- Returns:
- the object
- - (DXMLWriter *) init :(id <DTextWritable>) destination :(char) separator
- Initialise a xml writer with a destination file
- Parameters:
- destination - the xml file
separator - the namespace separator
- Returns:
- the object
- Copy related methods
- - shallowCopy
- Do a shallow copy of the object (not implemented)
- Returns:
- the object
- Deconstructor
- - free
- Free the object
- Returns:
- the object
- Writer methods
- - (BOOL) attribute :(const DXMLChar *) attribute :(const DXMLChar *) value
- Write an attribute for an element
- Parameters:
- attribute - the attribute
value - the value for the attribute
- Returns:
- success
- - (BOOL) characters :(const DXMLChar *) text
- Write a string of characters
- Parameters:
- text - the text of the characters
- Returns:
- success
- - (BOOL) comment :(const DXMLChar *) text
- Write a comment
- Parameters:
- text - the text of the comment
- Returns:
- success
- - (BOOL) endCDATA
- Write the end of a CDATA section
- Returns:
- success
- - (BOOL) endDocument
- Write the end of a document
- Returns:
- success
- - (BOOL) endElement
- Write the end of an element
- Returns:
- success
- - (BOOL) endNamespace
- End of a namespace declaration
- Returns:
- success
- - (void) error :(int) number :(const char *) name :(int) lineNumber :(int) columnNumber
- An error is found during the parsing of the file
- Parameters:
- number - the error number
name - the name of the config file
lineNumber - the line number in the config file
columnNumber - the column number in the config file
- Returns:
- success
- - (BOOL) processingInstruction :(const DXMLChar *) target :(const DXMLChar *) value
- Write a processing instruction
- Parameters:
- target - the target
value - the value
- Returns:
- success
- - (BOOL) start :(id <DTextWritable>) destination :(char) separator
- Start the writing of a xml file
- Parameters:
- destination - the xml file
separator - the namespace separator (or EOS for no namespaces)
- Returns:
- the object
- - (BOOL) startCDATA
- Write the start of a CDATA section
- Returns:
- success
- - (BOOL) startDocument :(const DXMLChar *) version :(const DXMLChar *) encoding :(int) standalone
- Write the start of a document
- Parameters:
- version - the version number (or NULL)
encoding - the encoding (or NULL)
standalone - is the xml document standalone (-1 = missing) ?
- Returns:
- success
- - (BOOL) startElement :(const DXMLChar *) name
- Write the start of an element
- Parameters:
- name - the name of the element
- Returns:
- success
- - (BOOL) startNamespace :(const DXMLChar *) prefix :(const DXMLChar *) uri
- Start of a namespace declaration
- Parameters:
- prefix - the prefix
uri - the uri
- Returns:
- success
- - (BOOL) unparsed :(const DXMLChar *) text
- Write unparsed text in the xml document (e.g. the DTD)
Note: there is no translation whatsoever done on this text.
- Parameters:
- text - the unparsed text
- Returns:
- success
generated 25-Jul-2006 by ObjcDoc 3.0.0