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 Slava Pestov <sl...@jedit.org> on 2002/03/05 23:31:19 UTC

A question about schemas and validation

Hello everybody,

I am developing an XML plugin for the jEdit text editor (www.jedit.org),
one of the features of the plugin is to give the user a list of declared
elements for one-click insertion into the current file. When Xerces
parses a file with a DTD, validation is performed and the declared
elements are passed to my DeclHandler's elementDecl() method. However,
if the file specifies a schema instead of a DTD, this is not the case;
the file is still validated, but elementDecl() is never called.

So my question is, how can I obtain a list of all declared elements,
attributes and entities if the file was validated using a schema? Do I
have to resort to Xerces-specific APIs to do this?

I am using Xerces-J 1.4.4.
-- 
Slava Pestov


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


Re: A question about schemas and validation

Posted by Slava Pestov <sl...@jedit.org>.
John,

I went ahead and upgraded to Xerces 2.0.1, and now I have a problem; the
old 'validation/dynamic' feature no longer seems to work. If I enable
the 'http://xml.org/sax/features/validation' feature, it prints errors
if the file in question does not define a DTD or schema. This is very
annoying and cannot be used in practice because it would require the
users of jEdit to manually enable and disable validation depending on
the file having a grammar or not. The 'validation/dynamic' feature in
Xerces 1.4.4 would validate if a DTD or schema was present, and fail
silently if not.

On Wed, 2002-03-06 at 11:52, John Utz wrote:
> Hello Slava;
> 
> in xerces-j 2 there is a sample app called ASModel that will share the
> elements of a schema with you.
> 
> but i dont think this functionality is available in 1.4.4.....
> 
> if you are avoiding using v2 for stability, i would go ahead and try it,
> it works pretty well for me....
-- 
Slava Pestov


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


Re: A question about schemas and validation

Posted by John Utz <ut...@singingfish.com>.
Hello Slava;

in xerces-j 2 there is a sample app called ASModel that will share the
elements of a schema with you.

but i dont think this functionality is available in 1.4.4.....

if you are avoiding using v2 for stability, i would go ahead and try it,
it works pretty well for me....

On 6 Mar 2002, Slava Pestov wrote:

> Hello everybody,
> 
> I am developing an XML plugin for the jEdit text editor (www.jedit.org),
> one of the features of the plugin is to give the user a list of declared
> elements for one-click insertion into the current file. When Xerces
> parses a file with a DTD, validation is performed and the declared
> elements are passed to my DeclHandler's elementDecl() method. However,
> if the file specifies a schema instead of a DTD, this is not the case;
> the file is still validated, but elementDecl() is never called.
> 
> So my question is, how can I obtain a list of all declared elements,
> attributes and entities if the file was validated using a schema? Do I
> have to resort to Xerces-specific APIs to do this?
> 
> I am using Xerces-J 1.4.4.
> -- 
> Slava Pestov
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> 
> 


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