X-document Load Function Returns Error

Kalan

Member
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.
 

RealHeavyDude

Well-Known Member
If you remove the no-error option from the statment that loads the document you will get the error message telling you what's wrong. The no-error option supresses the error message but you can still handle the error programatically using the error-status system handle. ( Have a look here OpenEdge 11.6 Documentation )

You don't mention your Progress / OpenEdge version so, depending on your version you could als use the structure error handling - which, IMHO, is way better than the error-status system handle.

Heavy Regards, RealHeavyDude.
 

Kalan

Member
Thanks RHD, identified the issue that one of the end-tag been missed. xmlvalidation.com/ helped to validate the xml file.
 
Top