Jzos and SAX parser

General discussion on the JZOS batch launcher and toolkit
Post Reply
cecperrez
Posts: 2
Joined: Tue Oct 03, 2006 10:57 am
Location: Belgium

Jzos and SAX parser

Post by cecperrez »

We are trying to run a stand-alone java application on z/OS.
This application parse and validate XML files.
We are using SAX parser to format the XML file but also to expand empty tags.
I noticed that when using jzos library to access the XML file ( on Mainframe but behaviour is the same on Unix ) the expand empty XML tags option does not work anymore.
Have you already heard about this problem?
Do you know if I should use another XML parser or maybe a specific version of SAX?
Thanks for your help.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

I'm sorry, but I don't understand what you mean by "use the jzos library to access the XML file". JZOS does not include an XML parser; thats part of the SDK.

Please explain.
cecperrez
Posts: 2
Joined: Tue Oct 03, 2006 10:57 am
Location: Belgium

Explanation

Post by cecperrez »

In fact I use jzos to get the file from the file system and SAX to parse the XML file. After several testing it appears that the "expand empty tag" option in SAX does not work if file is manipulated by jzos.
Here is the code example

Code: Select all

System.setProperty("javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp.SAXParserFactoryImpl");
SAXBuilder sax = new SAXBuilder(false);
Document d = sax.build(new InputStreamReader(FileFactory.newInputStream(fileName), encoding));
XMLOutputter out = new XMLOutputter();
Format format = out.getFormat();
format.setEncoding(encoding);
format.setExpandEmptyElements(true);
format.setLineSeparator(System.getProperty("line.separator"));
OutputStreamWriter outstream = new OutputStreamWriter(FileFactory.newOutputStream("fileName"), "UTF-8");
out.output(d, outstream);
outstream.flush();
outstream.close();
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

I do not believe that any "manipulation" of the file is occuring by JZOS in your example.

To prove it to yourself, try using java.io classes (without using FileFactory).

It could very well be that the XML Parser shipped with the z/OS SDK doesn't work as you expect with repect to "setExpanedEmptyElements()", but that is a different matter and unrelated to JZOS.
sashasuman
Posts: 1
Joined: Fri Dec 19, 2014 5:10 am

Re: Jzos and SAX parser

Post by sashasuman »

I found the problem - i had overriden #JO="$IJO -Djava.util.logging.config.file with an old file which no longer exists. i removed the entry and i now get STDOUT/STDERR output in tomcat 6.
Unlock the key of your success by 3101 brain dumps and testking.By using our latest testking.me - HP0-Y43 brain dumps and hodges study material, you can easily pass www.quincy.edu
Post Reply