DOM Builder Reference > DOM Builder Procedures
  
DOM Builder Procedures
The DOM Builder is a group of API methods written as internal procedures in two QAD Enterprise Applications programs that are run persistently.
General XML DOM Builder: gpdomcr.p
QDoc DOM Builder: gpqdoccr.p
The XML DOM Builder is a super-procedure of the QDoc DOM Builder, as the latter reimplements some of the general XML methods to automatically add attributes that appear in all valid QDocs, such as the QAD-defined XML namespaces. The QDoc DOM Builder should be started as persistent from QAD Enterprise Applications if the objective is to generate QDocs. It will automatically launch the XML DOM Builder. If the objective is to generate non-QDoc XML, the general XML DOM Builder should be started as persistent instead. Most of the methods are applicable to both QDocs and other XML documents, but some of the methods are QDoc-specific. See QDoc-Specific API Methods.Most programs that use the DOM Builder API would structure their method calls as follows:
Start gpqdoccr.p or gpdomcr.p running persistently, depending on whether the intent is to create QDocs or other kinds of XML documents.
Call createNewXMLDocument to create the XML document.
Call addNode, addNodeGroup, addRecordNode, addAttributes, and createException in combination in order to populate the XML document level-by-level, node-by-node.
Call getXMLAsTempTable, getXMLAsDOM, getXMLAsString, or getXMLAsFile to retrieve the completed XML document objects in the form required.
Call deleteDocument to delete the XML objects.
Important: Only a single XML document can be under construction at one time in a single QAD Enterprise Applications session. Each time createNewXMLDocument is called, any XML document already in process for that session is lost and a new one started.