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 element.

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)

]> 0 West Wind Web Connection 3.15 wconnect.gif WCONNECT 0 0 0 http://www.west-wind.com/webconnection/ 0


  • ** 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)

0 West Wind Web Connection 3.15 wconnect.gif WCONNECT 0 0 0 http://www.west-wind.com/webconnection/ 0

See also

Class wwXML (High Level Methods)

© West Wind Technologies, 2025 • Updated: 2025-03-12
Comment or report problem with topic