You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by ajay bhadauria <ab...@yahoo.com> on 2009/08/07 12:03:28 UTC

SAX events while compiling schema

Hi,

I am using javax.xml.validation.SchemaFactory to create SchemaFactory using newInstance ( SchemaLanguage) method. After that I get Schema Object using newSchema(source) method.

How do I register SchemaFactory so that I get all the SAX events ?

Thanks
Ajay



      

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: SAX events while compiling schema

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Ajay,

You haven't stated what you're actually trying to accomplish but I'd like
to point out that you can pass a SAXSource [1] as input to the
SchemaFactory. That SAXSource can contain an XMLFilter [2] that you've
written which wraps a real SAX parser and intercepts the SAX events (doing
whatever you feel like with them) before passing them on to the
ContentHandler that the SchemaFactory registered with your XMLFilter.

Thanks.

[1]
http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/transform/sax/SAXSource.html
[2]
http://xerces.apache.org/xerces2-j/javadocs/api/org/xml/sax/XMLFilter.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

ajay bhadauria <ab...@yahoo.com> wrote on 08/07/2009 01:23:30 PM:

> Hi,
>
> I can register SchemaFactory with errorHandler to get all the error,
> fatalError and warning while compiling schema but just wanted to
> know that Schema compilation (parsing ) is sax based or dom based
internally ?
>
> Can I register SchemaFactory to java ErrorHandler class to get all
> SAX events ?
>
> Thanks
> Ajay
>
> --- On Fri, 8/7/09, ajay bhadauria <ab...@yahoo.com> wrote:
>
> > From: ajay bhadauria <ab...@yahoo.com>
> > Subject: SAX events while compiling schema
> > To: j-users@xerces.apache.org
> > Date: Friday, August 7, 2009, 3:33 PM
> > Hi,
> >
> > I am using javax.xml.validation.SchemaFactory to create
> > SchemaFactory using newInstance ( SchemaLanguage) method.
> > After that I get Schema Object using newSchema(source)
> > method.
> >
> > How do I register SchemaFactory so that I get all the SAX
> > events ?
> >
> > Thanks
> > Ajay
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> > For additional commands, e-mail: j-users-help@xerces.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org

Re: SAX events while compiling schema

Posted by ajay bhadauria <ab...@yahoo.com>.
Hi,

I can register SchemaFactory with errorHandler to get all the error,fatalError and warning while compiling schema but just wanted to know that Schema compilation (parsing ) is sax based or dom based internally ?

Can I register SchemaFactory to java ErrorHandler class to get all SAX events ? 

Thanks
Ajay

--- On Fri, 8/7/09, ajay bhadauria <ab...@yahoo.com> wrote:

> From: ajay bhadauria <ab...@yahoo.com>
> Subject: SAX events while compiling schema
> To: j-users@xerces.apache.org
> Date: Friday, August 7, 2009, 3:33 PM
> Hi,
> 
> I am using javax.xml.validation.SchemaFactory to create
> SchemaFactory using newInstance ( SchemaLanguage) method.
> After that I get Schema Object using newSchema(source)
> method.
> 
> How do I register SchemaFactory so that I get all the SAX
> events ?
> 
> Thanks
> Ajay
> 
> 
> 
>       
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org