Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Reading-AppResponse #2

Closed
jhernancanom opened this issue Sep 5, 2021 · 4 comments
Closed

About Reading-AppResponse #2

jhernancanom opened this issue Sep 5, 2021 · 4 comments

Comments

@jhernancanom
Copy link

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

@nfoxdev
Copy link
Collaborator

nfoxdev commented Sep 6, 2021 via email

@jhernancanom
Copy link
Author

jhernancanom commented Sep 6, 2021 via email

@nfoxdev
Copy link
Collaborator

nfoxdev commented Sep 7, 2021 via email

@jhernancanom
Copy link
Author

jhernancanom commented Sep 7, 2021 via email

@nfoxdev nfoxdev closed this as completed Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants