I was thinking in terms of extending the grammar or the traversers(e,g XSDElementTraverser) to include checks for our profile....so that it works in a source agnostic manner...is that an option? Is there any place where these kind of extension points described?
-----Original Message----- From: Michael Glavassevich [mailto:[EMAIL PROTECTED] Sent: Thursday, September 21, 2006 8:23 PM To: [email protected] Subject: RE: Custom validation The SAX filter gives you an opportunity to do your custom validation as the schema documents are streamed to the SchemaFactory. Since you already have them in memory you can traverse the DOM trees at any time to you check your profile. Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] "Kar, Swayambhuba" <[EMAIL PROTECTED]> wrote on 09/21/2006 06:33:19 PM: > 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] --------------------------------------------------------------------- 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]
