"Decoker, Lydie \(Lydie\)" <[EMAIL PROTECTED]> wrote on 09/26/2006
05:39:30 AM:
> Oh yes I see. Sorry about that. I am just loosing my head trying to make
> this stuff working.
>
> I defined my XMLCatalogResolver:
>
> XMLCatalogResolver catalog1 = new XMLCatalogResolver();
>
> I have added to it to catalog using setCatalogList() method.
>
> I have tested to resolveURI to see if it really took into account my
> catalog:
> System.out.println(catalog1.resolveURI("http://my.uri.com/GRIPP/jmsPrope
> rties"));
>
> This test works fine. I got as output the location of my xsd file.
>
> I have added the catalogResolver to my parser:
> builder.setEntityResolver(catalog1);
>
> BUT when parsing and validating my XML file, I got:
> cvc-elt.1: Cannot find the declaration of element 'JMSProperties'.
>
> XMLCatalogResolver uses target namespace to resolve location. So in my
> xsd, I do not need to have the schemaLocation tag, right?
Only if the resolver interface you're using reports the target namespace.
EntityResolver does not. You need to use one of the other resolver
interfaces: LSResourceResolver or XNI's XMLEntityResolver. There's an
example of how to set an XMLCatalogResolver as the parser's
XMLEntityResolver in the FAQs [1].
> It should use: xmlns="http://my.uri.com/GRIPP/jmsProperties", right? The
> JMSProperties is the root tag:
>
> <JMSProperties xmlns="http://my.uri.com/GRIPP/jmsProperties"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
> ....
> </JMSProperties>
>
> Lydie.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
[1] http://xerces.apache.org/xerces2-j/faq-xcatalogs.html
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]