I have a fix for the problem now. I'll check it in soon.
1) We have a bug in ValidatingXMLStreamReader.next() which doesn't trigger
the startDocument(). As a result, all the elements are skipped from
validation. CompositeDocumentProcessor uses nextTag() while
DefinitionsDocumentProcessor uses next(). That's why we don't see problems
with composite files.
2) The DefaultSchemaValidationExtensionPoint is DISABLED by default. Should
we turn it on for unit tests? I understand we control the flag at NodeImpl
level too.
Thanks,
Raymond
--------------------------------------------------
From: "Simon Laws" <[email protected]>
Sent: Tuesday, August 11, 2009 3:57 AM
To: "tuscany-dev" <[email protected]>
Subject: [2.x] another validation question
For ASM_10003 I'm trying to turn on XSD validation for
definitions.xml. I changed DefinitionsDocumentProcessor to create the
input factory using the following...
this.inputFactory =
modelFactories.getFactory(ValidatingXMLInputFactory.class);
But I still don't see some expect validation errors. What else do I need
to do?
I do get an appropriate error from the processors....
11-Aug-2009 11:44:57
org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor
[Definitions:
jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml]
(ElementCannotBeProcessed)
SEVERE: Element
{http://docs.oasis-open.org/ns/opencsa/sca/200903}component cannot be
processed. ([row,col,system-id]:
[11,2,"jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml"])
org.oasisopen.sca.ServiceRuntimeException: [Definitions:
jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml]
- Element {http://docs.oasis-open.org/ns/opencsa/sca/200903}component
cannot be processed. ([row,col,system-id]:
[11,2,"jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml"])java.lang.IllegalStateException:
org.oasisopen.sca.ServiceRuntimeException: [Definitions:
jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml]
- Element {http://docs.oasis-open.org/ns/opencsa/sca/200903}component
cannot be processed. ([row,col,system-id]:
[11,2,"jar:file:/C:/simon/tuscany/java-2.x/otest/current/tests/../ASM_10003/target/tuscany-otests-asm-ASM_10003.jar!/META-INF/definitions.xml"])
But I'd like to understand why validation is not apparently active.
Regards
Simon