Hello,

I have the following problem: I want to validate a XML snippet that
has the namespace attributes set at each element.

Since it is a snippet, it does not provide schema location
information, although I know the main schema that is being used, and
where it is located.

The problem is that that schema has <xsd:any> elements, which I
believe removes the possibility of having precompiled schema info as
in:

StreamSource a = new StreamSource("a.xsd");
StreamSource b = new StreamSource("b.xsd");

Schema schemas = sf.newSchema(new Source[]{a, b});

Validator validator = schemas.newValidator();

validator.setErrorHandler(myErrorHandler);

DOMSource docSource = new DOMSource(Doc);

validator.validate(docSource);

because I don't know b.xsd beforehand and the compiled schema cannot be updated.

What I know beforehand is that the elements in <xsd:any> will follow
schema from a previously know set, and that the namespace->location
mapping is know.

Does anyone have some suggestion of what I should do?

Or will I have to build a map of namespaces->Sources and compile the
aggregated schema in each evaluation?

Thanks,

João
-- 
O Insurgente - http://oinsurgente.org

Small Brother - http://small-brother.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to