Hi Sagara,

Those are DTD validation errors and you're probably getting them because
you're calling setValidating() [1] on the DocumentBuilderFactory. Don't set
this to true. DocumentBuilderFactory.setSchema() [2] supports a completely
different and independent validation mechanism. setValidating() and
setSchema() do not have an effect on each other's behaviour.

Thanks.

[1]
http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/parsers/DocumentBuilderFactory.html#setValidating(boolean)
[2]
http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/parsers/DocumentBuilderFactory.html#setSchema(javax.xml.validation.Schema)

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

"Sagara Gunathunga" <[EMAIL PROTECTED]> wrote on 11/09/2008
11:44:05 AM:

> Hi Mukul ,
> Your guess  is correct , once i remove those invalid Schema
> references it does not give any exception , thanks for your help .
> Also when i add invalid entry to the documents it shows the
> validation Errors ,but for all the documents ( valid WSDL )
> validator shows following two error messages ,  do you have any idea
.....?
>
>
> [Error] primer-hotelReservationService.wsdl:19:13: Document is
> invalid: no grammar found.
> [Error] primer-hotelReservationService.wsdl:19:13: Document root
> element "description", must match DOCTYPE root "null".
>
>
> Thanks,
>
>

> On 11/9/08, Mukul Gandhi <[EMAIL PROTECTED]> wrote:
> Just trying to make my best guess to the cause of this. Please read my
> answer below ...
>
>
> On Sun, Nov 9, 2008 at 9:04 PM, Sagara Gunathunga
> <[EMAIL PROTECTED]> wrote:
> >             Vector<String> schemas = new Vector();
> >
> >             schemas.add("http://www.w3.org/ns/wsdl ");
> >
> >             schemas.add(" http://www.w3.org/2007/03/wsdl/wsdl20.xsd";);
> >
> >             schemas.add(" http://www.w3.org/ns/wsdl-extensions ");
> >
> >             schemas.add("
> > http://www.w3.org/2007/03/wsdl/wsdl20-extensions.xsd";);
> >
> >             schemas.add(" http://www.w3.org/2001/XMLSchema ");
> >
> >             schemas.add(" http://www.w3.org/2001/XMLSchema.xsd";);
>
>
> I think the problem lies in the above statements. Each string you add
> to this vector is supposed to be a valid Schema URI.
>
> In your code above, some URIs don't point to a valid Schema (for e.g.,
> http://www.w3.org/ns/wsdl). The Schema processor gives syntax errors
> on these invalid Schema references.
>
> Hope I am right ... :)
>
>
>
> --
> Regards,
> Mukul Gandhi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

>
>
>
> --
> Sagara Gunathunga
>
> Blog - ssagara.blogspot.com
> Web - http://sagaras.awardspace.com/

Reply via email to