From cseyrat@acland.fr Wed Sep 13 17:58:55 2000 Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Received: (qmail 854 invoked from network); 13 Sep 2000 17:58:55 -0000 Received: from s3.smtp.oleane.net (195.25.12.10) by locus.apache.org with SMTP; 13 Sep 2000 17:58:55 -0000 Received: from smtp1.cluster.oleane.net (smtp1.cluster.oleane.net [195.25.12.16]) by s3.smtp.oleane.net (Postfix) with ESMTP id 49A2E2124E for ; Wed, 13 Sep 2000 10:52:28 +0200 (CEST) Received: from acland.fr ([194.206.157.46]) by smtp1.cluster.oleane.net with ESMTP id MAA22637 for ; Wed, 13 Sep 2000 12:06:28 +0200 (CEST) Message-ID: <39BF518A.A0B5325B@acland.fr> Date: Wed, 13 Sep 2000 12:06:02 +0200 From: Claude Seyrat X-Mailer: Mozilla 4.74 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: general@xml.apache.org Subject: Re: Way to link schema to parser instead of particular document instance? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hi, I have a small question : Will it be possible to apply transformation to the grammar just before its compilation ? Thanks, Claude. Jeffrey Rodriguez wrote: > > Hi Travers, > The answer is no in the current version of Xerces, but it is in the > list of feature to add to Xerces and in the design of Xerces2. > This feature is also known as Grammar caching. This is very useful > in Server environments. e.g. an SVG server. > > Grammar caching could be implemented as a combination of properties > and features. > A feature could be implemented such that it indicates the default > cache grammar ( dtd or schema) and a property sets the caching behavior for > the parser. The default would be to false so we don't cache a server > program could set the caching behavior to true so the default cache grammar > is used instead. > The cache grammar will be loaded once and reused multiple times > until the parser caching behavior is reset to false. > > Hope this helps, > > Jeffrey Rodriguez > IBM Silicon Valley > XML Development > > >From: "Travers Waker" > >Reply-To: general@xml.apache.org > >To: > >Subject: Way to link schema to parser instead of particular document > >instance? > >Date: Tue, 12 Sep 2000 09:53:40 +0200 > > > >Hi. > > > >I'm wondering if there is a way to make Xerces validate using a particular > >schema regardless of what XML document is being parsed. The way I get it > >to > >validate using a schema now is to set the schemaLocation to a file > >containing the schema in the XML document itself. > > > >This seems quite inefficient if you're validating many XML documents with > >the same schema. Every time a new document is parsed, the schemaLocation > >has to be read, the schema file (*.xsd) has to be loaded, the parser has to > >set itself up for validation with this scahem and only then can parsing and > >validation take place. > > > >What I would prefer to do is to tell the parser to always validate using a > >particular schema. This would eliminate the time wasted by reloading the > >schema file every time. This is important to me because the application > >I'm > >writing is a server that accepts XML formatted request messages from > >clients. The schema used is the same every time. It would be nice to > >initialize the parser to always use the same schema because: > > > >1. Less time wasted (as mentioned already). > >2. One doesn't want the incoming XML message dictating what schema is used > >to validate it - If and incorrectly formatted message makes its way into > >the > >server it will cause problems (eg null pointer exceptions because you are > >assuming data is present when it is not). Because of this, the server > >itself must decide what schema to apply to the incoming XML message. The > >only way I can think of doing this is to prepend the lines specifying the > >schemaLocation to each XML message as it arrives at the server, before it > >is > >parsed. To me, this seems more like a "quick and dirty" workaround than > >the > >proper way to achieve what I am trying to do. > > > >Has anyone got comments or suggestions? > > > >Thanks for any responses. > > > >Travers Waker > > > > > > > >--------------------------------------------------------------------- > >In case of troubles, e-mail: webmaster@xml.apache.org > >To unsubscribe, e-mail: general-unsubscribe@xml.apache.org > >For additional commands, e-mail: general-help@xml.apache.org > > > > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > > Share information about yourself, create your own public profile at > http://profiles.msn.com. > > --------------------------------------------------------------------- > In case of troubles, e-mail: webmaster@xml.apache.org > To unsubscribe, e-mail: general-unsubscribe@xml.apache.org > For additional commands, e-mail: general-help@xml.apache.org