My success with VFP9's XMLAdapter has been non-existent.
My client supplied XML file appears to be too complex to handle it since it always generates an error message when I execute:
Consequently I have reverted to using the DOMDocument approach.
And I have managed to navigate myself through simple XML documents finding 'fields' and 'values' by drilling down into the various element layers. So far so good.
But now when I examine my client's XML document via Notepad, I find that the single XML document contains multiple Processing Instruction lines
<?xml version="1.0" encoding="UTF-8"?>
and the following associated elements.
When attempting to use the DOMDocument approach I can execute the following code without generating any errors:
In the more simple XML documents I know what to do and how to handle the various Nodes, etc.
But in this more complex XML document I have no idea how to cycle through the various 'sub-documents' (my term for each piece following the unique <?xml version="1.0" encoding="UTF-8"?> strings).
Is someone out there familiar enough with using VFP with the XML DOMDocument to advise me how to sequentially step through the individual sub-docs 1, 2, 3, etc.
When I look for web references I only find simplistic XML doc examples - they don't tell me anything that I can't already handle.
But I have yet to find any web references to which DOM Objects to use to parse this complex of an example.
Any advice/suggestions you might have would be greatly appreciated.
OR, my first choice, if you can advise me as to how to utilize the VFP9 XMLAdapter or XMLtoCursor to parse/convert an XML document of this complexity I would be most greatful.
Thanks,
JRB-Bldr
My client supplied XML file appears to be too complex to handle it since it always generates an error message when I execute:
Code:
oXMLAdapter = NEWOBJECT('XMLAdapter')
mcXMLDoc = GETFILE("XML")
oXMLadapter.LoadXML(mcXMLDoc)
[B]XML Error: XML Parse Error: Invalid at top
level of document <filename>[/B]
Consequently I have reverted to using the DOMDocument approach.
And I have managed to navigate myself through simple XML documents finding 'fields' and 'values' by drilling down into the various element layers. So far so good.
But now when I examine my client's XML document via Notepad, I find that the single XML document contains multiple Processing Instruction lines
<?xml version="1.0" encoding="UTF-8"?>
and the following associated elements.
When attempting to use the DOMDocument approach I can execute the following code without generating any errors:
Code:
oXML = CREATEOBJECT('msxml2.DOMDocument.4.0')
mcXMLDoc = GETFILE("XML")
oXML.LOAD(mcXMLDoc)
In the more simple XML documents I know what to do and how to handle the various Nodes, etc.
But in this more complex XML document I have no idea how to cycle through the various 'sub-documents' (my term for each piece following the unique <?xml version="1.0" encoding="UTF-8"?> strings).
Is someone out there familiar enough with using VFP with the XML DOMDocument to advise me how to sequentially step through the individual sub-docs 1, 2, 3, etc.
When I look for web references I only find simplistic XML doc examples - they don't tell me anything that I can't already handle.
But I have yet to find any web references to which DOM Objects to use to parse this complex of an example.
Any advice/suggestions you might have would be greatly appreciated.
OR, my first choice, if you can advise me as to how to utilize the VFP9 XMLAdapter or XMLtoCursor to parse/convert an XML document of this complexity I would be most greatful.
Thanks,
JRB-Bldr