SAX Writer Reference > Introduction > SAX Writer Class
  
SAX Writer Class
The QDoc SAX Writer class is called com.qad.xml.QdocSAXWriter. The SAX Writer class is available for OpenEdge 10.1A and over. The SAX Writer is a stand-alone program that must be started using standard OO4GL constructs. For example:
define variable oQdocSAXWriter as class com.qad.xml.QdocSAXWriter.
oQdocSAXWriter = new com.qad.xml.QdocSAXWriter().
The QDoc SAX Writer can be used in several ways:
Create every node in the QDoc manually.
Create some nodes manually and pass a ProDataSet to populate other nodes.
Create some nodes manually and pass a buffer handle to populate other nodes.
Create some nodes manually and include an XML document fragment.
Pass just the QDoc parameters and a ProDataSet to create the QDoc automatically.
All methods to create an XML document follows the same structure.
1 Set the XML output method. Use one of the three methods setOutputToLongChar, setOutputToFile, or setOutputToMemptr to specify the output type.
2 Set the QDoc XML syntax. Use the method setQDocXMLSyntax10 or setQDocXMLSyntax11.
Note: Steps 3, 4, and 5 can be combined into one call by using the buildQdocFromProDataSet method, or each step can be performed individually.
3 Start the document. Use one of four methods: startDocument, startQdocSOAPEnvelope, startQdocSOAPBody, or startQdocRequestBody.
4 Add the nodes. Use the methods addNode, addNamespace, addNodesFromBuffer, addAllNodesFromBuffer, or addNodesFromProDataSet.
5 End the document. Use the writeDocument method.
6 Get the document. Use the getXMLAsLongChar and getXMLAsMemptr methods.