X-document Load Function Returns Error

Posted by Karikalan Ram on 26-Jul-2016 17:05

Hi,

Could someone please tell me how to debug when X-document load function returns error on below scenario, not sure why I get an error while loading valid XML file. May I know how load function validates/return error on this case.

Thanks.

pseudo code data/code:
================
Sample.xml content,
<?xml version="1.0"?>
Nested nodes follow this above line

cFileName = "C:\Temp\Sample.xml".
CREATE X-DOCUMENT hDocument.
ASSIGN lvError = hDocument:LOAD("FILE":U, cFileName, FALSE) no-error.

Here lvError value as FALSE as LOAD method not successful.

Posted by Ken McIntosh on 26-Jul-2016 17:13

Hi Karikalan,

Not sure what *exactly* your question is.  Are you saying simply having <?xml version="1.0"?> in the XML causes an error, or something in the "Nested nodes..."?

The value of ERROR-STATUS:GET-MESSAGE(1) should tell you more about the error.

What have you used to validate the XML you're loading?  You can paste or upload your XML to http://www.xmlvalidation.com to check for errors.

Regards,

Ken Mc

Posted by Dileep Dasa on 27-Jul-2016 02:32

As Ken said, you can see value of ERROR-STATUS:GET-MESSAGE(1) to get the error message or you can temporarily remove "NO-ERROR" and run the procedure to directly see the error.

All Replies

Posted by Ken McIntosh on 26-Jul-2016 17:13

Hi Karikalan,

Not sure what *exactly* your question is.  Are you saying simply having <?xml version="1.0"?> in the XML causes an error, or something in the "Nested nodes..."?

The value of ERROR-STATUS:GET-MESSAGE(1) should tell you more about the error.

What have you used to validate the XML you're loading?  You can paste or upload your XML to http://www.xmlvalidation.com to check for errors.

Regards,

Ken Mc

Posted by Dileep Dasa on 27-Jul-2016 02:32

As Ken said, you can see value of ERROR-STATUS:GET-MESSAGE(1) to get the error message or you can temporarily remove "NO-ERROR" and run the procedure to directly see the error.

Posted by Karikalan Ram on 27-Jul-2016 03:11

Excellent, In the nested nodes one of the node is not terminated with end-tag( Its difficult to check since vast content).

Suggested link http://www.xmlvalidation.com  highlighted an exact issue. Thanks a lot.

This thread is closed