Use the XML validator tool, XMLValidator
to check the correctness
of your XML files. The XML validator tool generates a Forms XML Schema "on
the fly" and uses it to check the correctness of any specified XML file.
The tool can be called from the command line to validate .xml
files
or called from a Java program to validate oracle.xml.parser.v2.XMLDocument
Java objects. You can also use the convenience scripts
that are provided with the Forms installation.
To validate XML files from the command line:
The XML validator tool can be called from the command line with one or more files as arguments. The syntax for the command is:
frmxmlv [options]
file1 [
file2]
java oracle.forms.util.xmltools.XMLValidator
file1.xml
[
file2.xml
...]
To validate XML files from a Java program:
For example, in your program you could define an object of type XMLValidator
and use it in a try
/catch
block to validate an XML
file represented by doc
.
... XMLValidator validator = new XMLValidator(); try { validator.validateXML(doc); } catch(Exception e) {
// validate failed.
} ...
You could (and probably should) catch the specific exceptions thrown and deal with them accordingly.