Thanks for the input. In our case the input source to the Schema factory is a DOMSource...to introduce filters I need to load up the documents in a SAXSource..right? Is there a way to do the same thing using the DOMSource?
-----Original Message----- From: Michael Glavassevich [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 20, 2006 9:17 PM To: [email protected] Subject: RE: Custom validation Take a look at SchemaFactory [1]. You can pass it a SAXSource [2] as input. If you wanted to check the rules of your profile as the schema is read by a SchemaFactory you would need to insert this logic between it and the parser. An XMLFilter allows you to do that. You can read more about them here [3]. [1] http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/validation/Sch emaFactory.html [2] http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/transform/sax/ SAXSource.html [3] http://www.cafeconleche.org/books/xmljava/chapters/ch08.html Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] "Kar, Swayambhuba" <[EMAIL PROTECTED]> wrote on 09/20/2006 06:50:13 PM: > > Could you please be more elaborate? > -----Original Message----- > From: Michael Glavassevich [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 20, 2006 3:13 PM > To: [email protected] > Cc: Kar, Swayambhuba > Subject: Re: Custom validation > > The schema loader does accept SAX as an input so you could also write a > filter [1] which checks the additional restrictions as the schema > document > is being parsed. > > [1] > http://xerces.apache.org/xerces2-j/javadocs/api/org/xml/sax/XMLFilter.ht > ml > > Michael Glavassevich > XML Parser Development > IBM Toronto Lab > E-mail: [EMAIL PROTECTED] > E-mail: [EMAIL PROTECTED] > > [EMAIL PROTECTED] wrote on 09/20/2006 05:57:34 PM: > > > Create a subset of the schema-for-schemas which implements your > > restrictions, and validate the schema document(s) against that? > > > > ______________________________________ > > "... Three things see no end: A loop with exit code done wrong, > > A semaphore untested, And the change that comes along. ..." > > -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish (http://www.ovff. > > org/pegasus/songs/threes-rev-11.html) > > --------------------------------------------------------------------- > 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]
