wwXML::ObjectToXML
This high level method converts a live object reference to XML. All variables are converted to text and stored.
Optionally can nest objects using the lRecurseObjects property flag. You can also create an optional DTD for the object with the lCreateDataStructure property, but only if objects are not recursed multiple levels.
You can set the document root name (xdoc in the document) with the cDocRoot.
o.ObjectToXml(loObject, lcName, lnIndent, llNoHeader)
XML string
Parameters
loObject
Object reference to represent as XML
lcName
- Optional* - Name of attribute used for the
lnIndent
- Optional* - Starting indentation level. Default 0.
llNoHeader
- Optional* - Create XML document without XML header. Default: .F.
Example
** DTD Example oXML = CREATE("wwXML")
** Load Business object oItem = CREATEOBJECT("cItem") ? oITem.getitembysku("WCONNECT")
oXML.nCreateDataStructure = 1 && Schema lcXML = oXML.ObjectToXML(oItem.oData) ShowXML(lcXML)
]>
wconnect.gif
** Schema Example oXML = CREATEOBJECT('wwXML')
** Load Business object oItem = CREATEOBJECT("cItem") ? oITem.getitembysku("WCONNECT")
oXML.nCreateDataStructure = 1 && Schema lcXML = oXML.ObjectToXML(oItem.oData) ShowXML(lcXML)
See also
Class wwXML (High Level Methods)© West Wind Technologies, 2025 • Updated: 2025-03-12
Comment or report problem with topic