Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/Development/ProjectXMLSchemaValidation

< EclipseLink‎ | Development
Revision as of 16:06, 28 July 2008 by Michael.norman.oracle.com (Talk | contribs) (Schema Validation)

Schema Validation

EclipseLink 'native' Project XML is described in the EclipseLink jar in xsd\eclipselink_persistence_map_1.0.xsd, along with the previous TopLink versions in xsd\toplink-object-persistence_1x_y_z.xsd.

When a Project XML file is read in, EclipseLink attempts to validate it against the above schemas. However, schema validation in Java has mostly been a 'hit-&-miss' affair, with different XML parsers providing very different results. Of specific interest is the use of org.xml.sax.EntityResolver's to manage the lookup of xsds. The callback is:

public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException

For example, the Oracle V2 XML Parser populates the systemId argument with a relative-path to the xsd directory in the eclipselink.jar file; however, the Xerces parser provided with Sun's JDK 1.5 populates it with a fully-resolved path. In addition, if the schema to-be-resolved imports another schema, then this second-level of resolving does not work with either parser.

Back to the top