This is the information that the XML string has.
<?xml version="1.0" encoding="UTF-8"?>
<string xmlns="http://tempuri.org/">
<statusInfo><vendorClaimID>BRADY12478018AETNA</vendorClaimID>
<statusID>0</statusID><statusDescription>Unvalidated</statusDescription>
</statusInfo></string>
But this is how it comes in.. You will have to scroll to the right to see all of it.
'<?xml version="1.0" encoding="utf-8"?>'#$D#$A'<string xmlns="http://tempuri.org/"><statusInfo><vendorClaimID>BRADY12478018AETNA</vendorClaimID><statusID>0</statusID><statusDescription>Unvalidated</statusDescription></statusInfo></string>'
I have loaded the string into a XMLDoc, but don't know how to access the values easily from here..
var
doc: IXMLDocument;
doc := LoadXMLData(xmlString);
Thanks!
Each node in the XML will be represented as an
IXMLNode
in theIXMLDocument
, in the same hierarchy that they appear in the XML. It would help if you first look at the XML with the nodes indented so you can see the hierarchy more clearly:One you understand the hierarchy, you can write code for it:
Alternatively:
If you use Delphi's XML Data Binding wizard, it will generate interfaces that will parse the XML for you:
You can use XPath to extract the values of the nodes
Check this sample