Parse XML issues.

I am having two issues using the Parse XML command.

  1. The command is just “PARSE” on the mainframe (4.3), but is “PARSE XML” using Natural Studio (6.3). This causes an issue when attempting to catalog a program that uses the Parse XML command on either the mainframe or in Studio (depending on which syntax the program is using). Is there fix for this issue?

  2. The mainframe version of the Parse XML command is not properly handling output escaping. I tested by creating a PDA and it’s parse and serialize modules - then executed a program that loads data into the PDA, serializes the data to an XML string, resets the PDA, and then parses the XML string to the PDA. I did verify that the serialize is properly writing out the data. Here are results of parsing tests using the mainframe (4.3) and Studio (6.3):

PDA field loaded with: 1234567890

Mainframe after parse: 1234567890

Studio after parse: 1234567890

PDA field loaded with: 1234<56>7890

Mainframe after parse: 7890

Studio after parse: 1234<56>7890

PDA field loaded with: 12345&67890

Mainframe after parse: 67890

Studio after parse: 12345&67890

Any ideas on what the fix for this might be? I was thinking that it could be a code page issue, but it would seem odd that the default code page on the mainframe wouldn’t be able to handle the translation since I’m using IBM037 encoding (EBCDIC) and data that is generated and processed on the mainframe.

Any help or information about these two issues would be greatly appreciated and I thank, in advance, anyone who takes time to respond!

Steven Ystebo
California State Teachers’ Retirement System

ad 1) It’s PARSE XML on the mainframe as well. PARSE alone will not check, but getting a NAT0001 syntax error.

ad 2) The issue with the predefined entities (< > etc) causing multiple callbacks will be resolved with Natural 425!

Harald Sauer

Regarding question 2:
Is there any way to get around this without waiting for version 425, such as a patch that’s available now? Output escape processing is a base necessity of any XML reader, so it would be difficult to move forward with that flaw not resolved.

Regarding question 1:

DEFINE DATA
LOCAL
1 #XML-INPUT (A) DYNAMIC
1 #XML-PATH (A) DYNAMIC
1 #XML-CONTENT (A) DYNAMIC
END-DEFINE
*
PARSE XML #XML-INPUT INTO PATH #XML-PATH
VALUE #XML-CONTENT
END-PARSE
*
END

The above program will not stow. I get the following error (with the cursor positioned at the XML statement):
NAT0285 Field reference error; reference invalid or missing.

Once I change the PARSE XML to just PARSE, it stows and executes correctly. Would you give me information about your version levels? I’m interested in knowing how your installation is properly resolving PARSE XML.

Thank you for your reply!

I tested your program on Natural 4.2.2 and 4.2.4 - PARSE XML stows correctly. Omitting the “XML” causes a “NAT0728 Keyword XML expected” error.

Thanks, Douglas.

Before I contact our data center to open a ticket, do you have any thoughts on what might be causing the behavior I experience? A Natural parm, keyword table, etc…?

You could check the NATTXT members to make sure they weren’t incorrectly modified.

You indicated that you were using Natural 4.3, but the highest level released is 4.2.4. Use the SYSPROD command to verify your version numbers.

I’ll check on that. Thanks again for your response.

That should read version 4.23, not version 4.3 - left the 2 out twice, it appears.