You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Erik van Zijst <er...@erik.prutser.cx> on 2006/09/22 11:56:59 UTC

Usage of the non-standard (experimental) API methods

Hi folks,

When parsing an xml file, we need to apply validation against an xml
schema file. We do not want to rely on the xsi:schemaLocation attribute
in the xml file itself, but instead we want to provide a schema to the
parser explicitly.

What's more, as the caller we want to supply the schema to the parser
through an istream (rather than pointing the parser to a file name or a
URL). This allows us to use schemas dynamically.

We are now using the DOMBuilder::loadGrammar(const DOMInputSource
&source, ...) method which appears to work fine. However, this method is
labeled as "Experimental - subject to change".

What is the intended use for this method? Can I use it, or is there a
"proper" alternative way among the standard methods that I should use?

kind regards,
Erik van Zijst


Re: Usage of the non-standard (experimental) API methods

Posted by Alberto Massari <am...@datadirect.com>.
Hi Erik,
using loadGrammar is the proper way to preload a schema before 
validation (provide that you cache the schema, turn on the flag 'use 
cached schemas' and force the validation scheme to be 'always').
As for the experimental notice, it has been removed in the upcoming 
3.0 release - but the signature did indeed change: with the 
completion of the DOM L3 support, both DOMBuilder and DOMInputSource 
changed their names.
So, you can safely use it, and its semantic will be the same in the 
next versions of Xerces.

Alberto

At 11.56 22/09/2006 +0200, Erik van Zijst wrote:
>Hi folks,
>
>When parsing an xml file, we need to apply validation against an xml
>schema file. We do not want to rely on the xsi:schemaLocation attribute
>in the xml file itself, but instead we want to provide a schema to the
>parser explicitly.
>
>What's more, as the caller we want to supply the schema to the parser
>through an istream (rather than pointing the parser to a file name or a
>URL). This allows us to use schemas dynamically.
>
>We are now using the DOMBuilder::loadGrammar(const DOMInputSource
>&source, ...) method which appears to work fine. However, this method is
>labeled as "Experimental - subject to change".
>
>What is the intended use for this method? Can I use it, or is there a
>"proper" alternative way among the standard methods that I should use?
>
>kind regards,
>Erik van Zijst