It's your code. You chose the APIs you're using. Presumably you set an 
org.xml.sax.EntityResolver on the parser by calling 
"builder.setEntityResolver(catalog1)". The FAQ shows how to set an 
XMLEntityResolver. If you're not sure what certain interfaces and methods 
do I suggest you take a deeper read of the Javadocs and other 
documentation.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

"Decoker, Lydie \(Lydie\)" <[EMAIL PROTECTED]> wrote on 09/26/2006 
10:16:31 AM:

> Not sure I got your point. I read the FAQ and I do not see what has been
> done in more.
> How can I know which Resolver interface is used by my application?
> 
> BTW I appreciate your help :o) 
> 
> -----Original Message-----
> From: Michael Glavassevich [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, September 26, 2006 16:07
> To: [email protected]
> Subject: RE: Trying to validate XML files using several XSD
> 
> "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/jmsPro
> > pe
> > 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]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to