A customer sends me a file attachment via e-mail. The file is a HTML purchase order. I have stripped the attachment from the e-mail and then used
pub.xml.xmlstrintoXmlNode
pub.xml:queryXMLNode
map
at the moment I use the queryXMLNode to find the PO header, customer name etc OK, but now I want to loop through a table of detail records and am having trouble working out how to do it. The XML services guide p48 says you can retrieve the entire contents of a table but I haven’t been able to get this to work.
Has anyone done this?
If you are using the Developer Query creator UI to define they queries, then you can run the service once in Trace mode, and then you will be able to see the results of any particular query instantly. Also, you should be able to browse the tree of the incoming document and select an element/attribute that you want and right click to have a query generated for you (a big help for deeply nested data). This generated query will be for a specific element/attribute, but you can modify the generated query from something like:
doc.table[0].tr[0].td[0].text
to something that returns all the results you want in one data structure:
doc.table[0].tr.td.text
The later query would return a StringTable.
If this doesn’t help, please post a sample of the HTML document.
Cheers,
Fred