Hi Michael,
In the "jaxp.TypeInfoWriter" sample main() method, after the creation of
"ValidatorHandler" line,

   ValidatorHandler validator = schema.newValidatorHandler();

I added this line,

   writer.setPSVIProvider((org.apache.xerces.xs.PSVIProvider)validator);

But I got this error,

error: Parse error occurred -
com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl
java.lang.ClassCastException:
com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl
        at TypeInfoWriter.main(TypeInfoWriter.java:558)

In the FAQ link you sent, it says "javax.xml.validation.Validator and
javax.xml.validation.ValidatorHandler also implement the
org.apache.xerces.xs.PSVIProvider interface." But, from Java api doc, I
could not tell the interface is implemented.

Did I get the wrong ValidatorHandler implementation class? but that's OOB
sample code.

thanks a lot,
-david


On Tue, Jun 23, 2009 at 9:59 AM, Michael Glavassevich
<mrgla...@ca.ibm.com>wrote:

> govelogo <govel...@gmail.com> wrote on 06/23/2009 07:26:55 AM:
>
>
> > Do you mean I can cast "javax.xml.validation.ValidatorHandler" into
> > a "org.apache.xerces.xs.PSVIProvider"? I can not see how to do that
> > from java their doc.
>
>
> Have you tried this? It should work. See "How do I access PSVI via the
> JAXP 1.3 Validation API?":
> http://xerces.apache.org/xerces2-j/faq-xs.html#faq-8.
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrgla...@ca.ibm.com
> E-mail: mrgla...@apache.org
>
>

Reply via email to