Type substitution in Extensible Layer prevents DDMSence validation

Description

Taken from this discussion thread

The DDMS Extensible Layer (pre-DDMS 5.0) allows arbitrary content at the end of a DDMS metacard. If this extensible layer uses type substitution (via xsi:type), the underlying XMLReader will fail validation, as the schema from which the type originates is not in the external schema chain. Need to investigate further to decide course of action. Likely outcomes (mutually exclusive):

1) Enforce only syntax correctness in the Extensible Layer, not external schema content.
2) Allow the XMLReader to discover referenced external schemas that allow the Extensible Layer to be fully validated when it contains type substitution.
3) Provide configuration options for one or more of the above.

Environment

None

Attachments

2

Activity

Show:

Brian UriJuly 3, 2015 at 3:14 PM

Test Files:
https://code.urizone.net/svn/ddmsence/trunk/data/test/2.0/DDMSENCE-223.xsd
https://code.urizone.net/svn/ddmsence/trunk/data/test/2.0/DDMSENCE-223.xml

Success Pseudocode
DDMSReader reader = new DDMSReader(DDMSVersion.getVersionFor("2.0"));
reader.addExternalSchemaLocation("https://ddmsence.atlassian.net/browse/DDMSENCE-223", "data/test/2.0/DDMSENCE-223.xsd");
reader.getDDMSResource(new FileReader(new File("data/test/2.0/DDMSENCE-223.xml"));

Brian UriJuly 3, 2015 at 3:06 PM

Code changes committed in r1001.

Brian UriJuly 3, 2015 at 2:44 PM

The Xerces2 J SAXParser doesn't have a way to selectively suppress this validation of the Extensible Layer while keeping schema validation intact for the larger DDMS metacard. Also investigated the "http://apache.org/xml/features/validation/schema/ignore-xsi-type-until-elemdecl" SAX Feature, but it had no effect in this case.

It is possible to open up the XMLReader and allow additional schemas to be inserted into the external schema location chain. In this way, the schema defining the extensible content can be used for full validation. This works in my small-scale tests.

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created July 1, 2015 at 4:50 PM
Updated July 3, 2015 at 3:14 PM
Resolved July 3, 2015 at 3:09 PM