Methods effected
|
Description
|
All
|
If a particular method is called when the WRITE-STATUS attribute status value is an illegal value for the method, the method fails and generates an error message. See Errors raised by invalid method calls during SAX-writer states for more information.
|
END-DOCUMENT( )
|
If the root tag is not closed and END-DOCUMENT is called, the method fails and generates the following message:
END-DOCUMENT attempted to close the document before the root tag was closed.
You must close the root tag with END-ELEMENT before closing the document
|
START-ELEMENT( )
WRITE-EMPTY-ELEMENT( ) WRITE-DATA-ELEMENT( ) |
If FRAGMENT is FALSE, then there may be only one root node, that is, the document-level node. If a call to one of these methods would result in a second document-level node then the following error message is generated:
<method> attempted to create a second document level node in the document.
You must limit each XML document to one document-level node.
|
END-ELEMENT( )
|
For each START-ELEMENT method call, you must have a corresponding and matching END-ELEMENT method call. Start and end all nodes to properly form parent and child relationships. All nodes must be started and ended (excluding empty nodes). If END-ELEMENT is called with the incorrect name and prefix, then it fails and generates the message:
END-ELEMENT attempted to close the tag <qname> when the current tag to close was <qname>.
Do not interweave different start and end tags.
|
WRITE-CHARACTERS( )
|
Only call WRITE-CHARACTERS from within the document. That is, call it from within the root node. If it is called at the document level, it will fail and generate the following error:
WRITE-CHARACTERS attempted to write character
data at the document level. |
INSERT-ATTRIBUTE( )
DECLARE-NAMESPACE( ) |
Attribute names must be unique. If a call to either of these methods results in a repeated instance of a name, then the methods fail and the following error message will be generated:
<method> attempted to create a second instance of the name <name>.
Also, these methods can only be called when the WRITE-STATUS is SAX-WRITE-TAG or they fail and generate an error message as described in Errors raised by invalid method calls during SAX-writer states. For example:
hSAXWriter:STRICT = TRUE.
hSAXWriter:START-DOCUMENT( ). hSAXWriter:START-ELEMENT("root",""). hSAXWriter:START-ELEMENT("name",""). hSAXWriter:WRITE-CHARACTER("Fred Smith", 16). hSAXWriter:END-ELEMENT("root",""). /*method fails */ hSAXWriter:END-DOCUMENT( ).
This code fragment would generate an error because root was closed before name.
|