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.
Jzos and SAX parser
Explanation
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
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();
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.
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.
-
- Posts: 1
- Joined: Fri Dec 19, 2014 5:10 am
Re: Jzos and SAX parser
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