Try OpenEdge Now
skip to main content
Working with XML
Writing XML Documents with the Simple API for XML (SAX) : Handling errors : Errors raised by invalid method calls during SAX-writer states
 

Errors raised by invalid method calls during SAX-writer states

Certain methods may only be called when the writer is in certain states. For example, most of the writing methods, like START-ELEMENT, can only be called while WRITE-STATUS is neither SAX-WRITE-IDLE nor SAX-WRITE-COMPLETE.
The following table describes the invalid method calls WRITE-STATUS vs. methods and attributes.
Table 18. Valid method calls by WRITE-STATUS value
Method
Invalid for these WRITE-STATUS values
SET-OUTPUT-DESTINATION
SAX-WRITE-BEGIN, SAX-WRITE-TAG, SAX-WRITE-CONTENT, SAX-WRITE-ELEMENT, SAX-WRITE-ERROR
START-DOCUMENT
SAX-WRITE-BEGIN, SAX-WRITE-TAG, SAX-WRITE-CONTENT, SAX-WRITE-ELEMENT, SAX-WRITE-ERROR
END-DOCUMENT
SAX-WRITE-IDLE, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
START-ELEMENT
SAX-WRITE-IDLE, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
END-ELEMENT
SAX-WRITE-IDLE, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
WRITE-CHARACTERS
SAX-WRITE-IDLE, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
WRITE-EMPTY-ELEMENT
SAX-WRITE-IDLE, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
WRITE-DATA-ELEMENT
SAX-WRITE-IDLE, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
WRITE-FRAGMENT
SAX-WRITE-IDLE, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
WRITE-PROCESSING-INSTRUCTION
SAX-WRITE-IDLE, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
WRITE-COMMENT
SAX-WRITE-IDLE, SAX-WRITE-BEGIN, SAX-WRITE-CONTENT, SAX-WRITE-ELEMENT, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
INSERT-ATTRIBUTE
SAX-WRITE-IDLE, SAX-WRITE-BEGIN, SAX-WRITE-CONTENT, SAX-WRITE-ELEMENT, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
DECLARE-NAMESPACE
SAX-WRITE-IDLE, SAX-WRITE-BEGIN, SAX-WRITE-CONTENT, SAX-WRITE-ELEMENT, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
WRITE-EXTERNAL-DTD
SAX-WRITE-IDLE, SAX-WRITE-TAG, SAX-WRITE-CONTENT, SAX-WRITE-ELEMENT, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
WRITE-ENTITY-REF
SAX-WRITE-IDLE, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
WRITE-CDATA
SAX-WRITE-IDLE, SAX-WRITE-COMPLETE, SAX-WRITE-ERROR
RESET
None