oracle.forms.util.xmltools
Class XMLValidator

java.lang.Object
  |
  +--oracle.forms.util.xmltools.XMLValidator

public class XMLValidator
extends java.lang.Object

Used to validate XML against the Forms XMLSchema. The schema is generated dynamically using the oracle.forms.util.xmltools.SchemaGenerator class and does not require the schema file to be present in the file system.
The tool can be used on the command line or called from another Java class using the appropriate methods.

To use this tool the user will need the Forms Jdapi (Java Design-time API) on their classpath.


Constructor Summary
XMLValidator()
          Creates a new XMLValidator object ready to validate XML at URLs given to the validateXML() methods.
 
Method Summary
static void main(java.lang.String[] args)
          Main method takes a filename, or filenames of XML files and validates the XML against the Forms XMLSchema.
 oracle.xml.parser.v2.XMLDocument validateXML(java.net.URL url)
          Validates the XML at the given URL against the Forms model XMLSchema.
 oracle.xml.parser.v2.XMLDocument validateXML(java.net.URL url, java.io.OutputStream out)
          Validates the XML at the given URL against the Forms model XMLSchema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLValidator

public XMLValidator()
Creates a new XMLValidator object ready to validate XML at URLs given to the validateXML() methods.
Method Detail

validateXML

public oracle.xml.parser.v2.XMLDocument validateXML(java.net.URL url)
                                             throws oracle.xml.parser.v2.XMLParseException,
                                                    oracle.xml.parser.schema.XSDException,
                                                    org.xml.sax.SAXException,
                                                    java.io.IOException
Validates the XML at the given URL against the Forms model XMLSchema. Prints any messages from the parser to System.out.
Parameters:
url - for the XML to validate.
Throws:
java.io.IOException - if the URL isn't valid.
org.xml.sax.SAXException - if the XML isn't valid.
oracle.xml.parser.v2.XMLParseException - if the XML isn't valid.
oracle.xml.parser.schema.XSDException - if there was an error in the Schema Builder.

validateXML

public oracle.xml.parser.v2.XMLDocument validateXML(java.net.URL url,
                                                    java.io.OutputStream out)
                                             throws oracle.xml.parser.v2.XMLParseException,
                                                    oracle.xml.parser.schema.XSDException,
                                                    org.xml.sax.SAXException,
                                                    java.io.IOException
Validates the XML at the given URL against the Forms model XMLSchema. Prints any messages from the parser to the given OutputStream.
Parameters:
url - for the XML to validate.
out - the output stream for the parser's errors.
Throws:
java.io.IOException - if the URL isn't valid.
org.xml.sax.SAXException - if the XML isn't valid.
oracle.xml.parser.v2.XMLParseException - if the XML isn't valid.
oracle.xml.parser.schema.XSDException - if there was an error in the Schema Builder.

main

public static void main(java.lang.String[] args)
Main method takes a filename, or filenames of XML files and validates the XML against the Forms XMLSchema.
Parameters:
args - the filename(s) to process