About Reading-AppResponse
jhernancanom opened this issue · 4 comments
Hi, Marco.
If Spanish is your native language, please.
I am using your nfXML to read an XML and convert it to a VFP-object.
I am triyng to get info from the XML I attach (Colombian Electronic Invoicing), but I am having troubles.
I have written an script --attached too-- for showing you. And I put several MessageBoxes for we to see.
This script was based on info that I found in
https://www.tek-tips.com/viewthread.cfm?qid=1753479
We run the sample. If we suspend and go to the Debugger, we can see the image #1.
I am interested (in this question) in cac_DocumentResponse, and its only three sub-elements inside it:
|------------------------|----------------|-----------------|
| | Debugger shows | My script shows |
|------------------------|----------------|-----------------|
|cac_DocumentResponse | | |
| cac_DocumentReference | object | object |
| cac_Response | array | object |
| cac_LineResponse | object | object |
|------------------------|----------------|-----------------|
I understand that I can get info from cac_DocumentReference and cac_Response directly as I show in image-04,....
But... I do not understand why the FOR EACH fails if the two FORs with AMEMBERS and GETPEM run both fine.
And also.... How can/should I walk thru the three sub-elements I mention before and thru the several cac:LineResponse's?
I show you two ways, but both fail. First inside the first FOR, and second commented inside #IF .F. and #ENDIF.
I use the method commented inside #IF .F. and #ENDIF, because the cac:LineResponse's can be several, non-defined how much.
I made some adjustments to nfXmlRead.prg as you can see marked as HCM, because nfXmlRead failed me in my scenarios.
Also I prefer LOCAL variables; nfXML.h inside nfXmlRead.prg is not mandatory; I used prefixes in mem vbles and parameters in order to prevent conflicts with vbles in our applications.
Please check them and try to adjust to a new version... where possible.
Thanks for sharing.
HERNAN CANO
Reading-AppResponse.zip