Hi Christian,

it sounds good, but the question is: how to load/look up the XSD in the validator component ?

I mean, in Karaf, to validate a feature XML, we use the following code:

SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        // root element has namespace - we can use schema validation
Schema schema = factory.newSchema(new StreamSource(FeatureValidationUtil.class

.getResourceAsStream("/org/apache/karaf/features/karaf-features-1.0.0.xsd")));

So we get the XSD for the bundle class loader. No problem so far.

The question is how the user can provide *efficiently* a XSD from outside the bundle.

I will get back to you with some solution that we can provide, which should work in both OSGi or non-OSGi worls :)

Regards
JB

On 11/12/2011 07:02 AM, Christian Müller wrote:
Hello all!

With [1], we add the functionality to Camel to validate XML files against
nested schema files with the camel validator component. So far so good...

We couldn't do this in the best possible way without to introduce an
additional dependency to xml-resolver. The current implementation doesn't
have this dependency but requires a lot more work to the user than it
should be. IMO the way to provide the best solution for our users is to
extract the Camel validator component into it's own project. There we can
have a dependency to xml-resolver and we can provide a good default
ResourceResolver implementation.

What do you think?

[1] https://issues.apache.org/jira/browse/CAMEL-4666

Best,
Christian


--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to