|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.org.ogsadai.common.XMLSchemaUtilities
Contains utility methods for working with XML schema documents.
| Constructor Summary | |
XMLSchemaUtilities()
|
|
| Method Summary | |
static void |
makeSchemaLocationsAbsolute(org.w3c.dom.Document doc,
java.lang.String base)
Converts the schemaLocation attributes of any import elements contained within the specified document to use absolute instead of relative paths. |
static void |
makeSchemaLocationsAbsolute(org.w3c.dom.Document doc,
java.net.URL base)
Converts the schemaLocation attributes of any import elements contained within the specified document to use absolute instead of relative paths. |
static void |
merge(org.w3c.dom.Document doc1,
org.w3c.dom.Document doc2)
Merges two XML document by importing the namespace attributes and child nodes of the root element of doc2 into doc1. |
static void |
removeAllIncludes(org.w3c.dom.Document doc)
Removes all the include elements from a document. |
static void |
removeIncludes(org.w3c.dom.Document doc,
java.lang.String schemaLocation)
Removes all the include elements with the specified schemaLocation attribute from the specified document. |
static void |
removeIncludes(org.w3c.dom.Document doc,
java.net.URL schemaLocation)
Removes all the include elements with the specified schemaLocation attribute from the specified document. |
static void |
validate(org.w3c.dom.Document document,
org.w3c.dom.Document schema)
Validates an XML Document against a specified XML schema
Document. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XMLSchemaUtilities()
| Method Detail |
public static void merge(org.w3c.dom.Document doc1,
org.w3c.dom.Document doc2)
doc1 - The document to import the nodes into.doc2 - The document to import the nodes from.
public static void makeSchemaLocationsAbsolute(org.w3c.dom.Document doc,
java.net.URL base)
throws CommonSystemException
doc - the XML schema Documentbase - the base URL that paths are specified relative to
CommonSystemException - if one of the schemaLocation attributes cannot be modified
into a well formed absolute URL path
public static void makeSchemaLocationsAbsolute(org.w3c.dom.Document doc,
java.lang.String base)
throws CommonSystemException
doc - the XML schema Documentbase - the base URL String that paths are specified
relative to
CommonSystemException - if the base URL is not well-formed or one of the
schemaLocation attributes cannot be modified into a
well-formed absolute URL pathpublic static void removeAllIncludes(org.w3c.dom.Document doc)
doc - the document to remove the include elements from
public static void removeIncludes(org.w3c.dom.Document doc,
java.net.URL schemaLocation)
doc - the Document to remove the include elements
fromschemaLocation - the URL value of the schemaLocation attributemakeSchemaLocationsAbsolute(org.w3c.dom.Document, java.net.URL)
public static void removeIncludes(org.w3c.dom.Document doc,
java.lang.String schemaLocation)
throws CommonSystemException
doc - the Document to remove the include elements
fromschemaLocation - the URL String value of the schemaLocation
attribute
CommonSystemExceptionmakeSchemaLocationsAbsolute(org.w3c.dom.Document, java.lang.String)
public static void validate(org.w3c.dom.Document document,
org.w3c.dom.Document schema)
throws CommonSystemException,
CommonUserException
Document against a specified XML schema
Document. This is achieved using a custom
SchemaEntityResolver that bypasses the normal mechanism
where a schema document would be loaded from a specified URL.
document - the Document to validate.schema - the XML schema Document
CommonSystemException - If a system problem prevents the validation.
CommonUserException - If the document does not validate against the schema
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||