Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse XML file in REXX.

Status
Not open for further replies.

33shady

Programmer
Jun 25, 2010
4
0
0
IL
Hi All,

I need to parse XML file using REXX in mainframe,
any body have any idea how can i do that?

Thanks & Regards
Shady
 
Why do you need to use Rexx? PL/1 and COBOL have parsing facilities.

That being said...please give a sample of your data so that we can see what you are needing.


Nic
 
Hi,

Thanks for your response.
actually I'am not familiar with COBOL.

I want a general script that Parse XML file.

Thanks

Shady
 
I doubt if you could create one as different XML files have different formats. I suggest you look at several XML files and see how you go about extracting the data manually, see what common processes you go through and then see if you can automate these. You need to be familiar with the data. I have over 3800 xml files on my PC - only one is mine - the rest belong to the system and various applications. Most of those that I have looked at (not many) are different. Yes, there are similarities which will help but there are differences.



Nic
 
Another thing - use Google to look up "rexx xml parser". There appears to be stuff already out there so why re-invent the wheel? Seems like IBM has one but it may only be for CMS but as it is source code it could be adapted as required. Others for PC could be obtained and changed for MVS - mainly the IO.


Nic
 
There is a PARSEXML exec on IBM's website that you can download and use as-is, if it meets your needs. I understand that it uses the same basic logic as the COBOL XML parsing function.

Personally, I use my own scaled-down version. Really, all you need to do is parse the xml string, looking for the starting tag '<....>' the value, and the ending tag '</.....>' in a loop.
 
Question: Works the PARSEXML only on mainframe, or works it on other platforms too?
 
XML is deceptively simple. Writing something to parse your XML is relatively easy. Writing something to parse any standards-compliant XML is a different thing altogether. By the time you've thrown in attributes, namespace handling, CDATA sections, etc. you've got a big piece of work on your hands. And if you want a validating parser that checks the XML against a schema, well let's just not go there shall we?

Consider using one of the pre-built solutions suggested above, rather than rolling your own...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Hi kevinpink,

can you please post the link to the PARSEXML exec on IBM's website, because I can't find it... :-(

Thanks
 
Hi mikrom,

I downloaded the xmlparse.vmarc - Archive. But I don't know how to get it on the z/OS. What is an vmarc-Archive?

Thanks
Adam
 
You need to use VMARC utility on mainframe to unpack it.

I only extracted the sources on my PC using the VMA utility from here:
 
Hi kevinpink,

can you please post the link to the PARSEXML exec on IBM's website, because I can't find it...

Thanks

It's File #647 of the CBT Tape:

File # 647 An XML parser written in REXX from Andrew Armstrong


The site will provide you with the directions for downloading the file and installing it into your libraries.
 
Hi,

I found the REXX XML parser from Andrew Armstrong on sourceforge.net:
From the link above you can download the zip-file and look into it, because it is in ASCII. Beatifull!

It seems to be sophisticated!

I think I will love it :)

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top