*One approach might be (assuming you have an XML organized [something] *like this: (xml) (table} (rows) (row) . some data as additional nodes or attributes . (/row) (row) . some data as additional nodes or attributes . (/row) (row) . some data as additional nodes or attributes . (/row) (/rows) (/table) *Okay - let's say you're only interested in the "row" elements that are *children the (rows) element. *Start your XML oXML=CREATEOBJECT("MSXML2.DOMDocument.4.0") &&Try an implicit connect to 4.0 oXML.async=.f. oXML.setProperty("SelectionLanguage","XPath") oXML.load(GETFILE()) && You may need to be local to the folder && to assure the XSD's merge && ALso note that 4.0 will merge XSD's that && Earlier XML objects "will not" merge. * Now create a reference to the (rows) element: oRows=oXML.selectSingleNode("*//*[local-name()='rows']") * Ho many (row) are in (rows) ?oRows.length * To point to a "row" oRow=oRows.item(n) * If the fields are stored as tags oFields=oRow.childNodes * If the fields are stored as attributes oFields=oRow.attributes * You could then address the nodenames and node texts or values using * a loop, or "literally" request the node names (in either case). * With attributes, some may be missing, you might need to verify they are * of the parent element: IF TYPE('oFields.getAttribute("txtSomeAttributeName")')==[C] * returns a "True", the attribute is there. * I am not sure about elements - I think I have written XMLs with an empty * element "(row)(/row). * You can also get a different result (a more exclusive set - fewer items) * depending on your XML heirarchy (i dont know why): oRow=oRows.selectNodes("*[local-name()='row']")There are features that associated with the tag when addressed as a "childNodes" and features that are associated when item(s) are addressed.
>>loXml = CreateObject("Microsoft.XMLDOM") >>loXml.Load ( YourXMLString ) >>loRoot = loXML.documentElement >>IF ISNULL( loRoot ) >> RETURN 'Invalid XML' >>ENDIF >>loElement = loRoot.selectSingleNode( "CustomerName" ) >>lCustomerName = iif(!ISNULL(loElement),allt(loElement.Text),"" ) >> >>lOrderNumbers = loRoot.selectNodes ("Orders/OrderNumber") >>for each loElement in lOrderNumbers >> ? loElement.Text >>endfor >> >>** you can also try loRoot.selectNodes ( "Orders/Blabla/Blablabla" ) >>>>