wwxml::XPathXmlValueToFoxValue

Works like XMLValueToFoxValue except that rather than accepting a string parameter it takes an XPATH expression and rootnode to retrieve a value from an XML document and translate it directly.

o.XPathXmlValueToFoxValue(loRootNode, lcXPath, lcType, @lvStore)

Return Value

FoxPro value that corresponds to this XML

Parameters

loRootNode
The XML DOM node from which to start the XPATH query.

lcXPath
The XPATH expression to find the element

lcType
The XML type of the element. (string,boolean,datetime,number,int,decimal etc.)

@lvStore
If passed the parsed data is assigned to this passed object.

Example

LOCAL loXml as wwXml
loXml = CREATEOBJECT("wwXml")
loDoc = loXml.LoadXml(lcXml)

loDocRoot = loDoc.DocumentElement
lcHeaderPath = "//soap:Envelope/soap:Body/PosResponse/Ver1.0/Header/"

? loXml.xpathvaluetofoxvalue(loDocRoot, lcHeaderPath + "GatewayRspMsg","string")
? loXml.xpathvaluetofoxvalue(loDocRoot, lcHeaderPath + "GatewayRspCode", "int")

See also:

Class wwxml

© West Wind Technologies, 1996-2018 • Updated: 12/17/15
Comment or report problem with topic