You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Chris Halverson <ch...@ncube.com> on 2000/12/12 23:35:41 UTC

Request for Definitive Grammar Access response from Xerces Develo pers

Perhaps one of the Xerces Developers can provide definitive feedback for the
ongoing thread regarding Grammar access. I know that the DocumentTypeImpl is
not 
a representation of the DTD, however it does have methods indicating that
you can access 
the grammar that don't work. The below statement ( taken from the
DocumentTypeImpl 
API docs Xerces 1.2.3 ) implies that the grammar for a parsed document
actually does 
reside in the Document Object, but without any parent object or accessor
path as 
"their appropriate NamedNodeMaps"  would appear to be hidden. 
Excert from DocumentTypeImpl API Docs
This class represents a Document Type declaraction in the document itself,
not a Document Type Definition (DTD). An XML document may (or may not) have
such a reference. 
DocumentType is an Extended DOM feature, used in XML documents but not in
HTML. 
Note that Entities and Notations are no longer children of the DocumentType,
but are parentless nodes hung only in their appropriate NamedNodeMaps. 
Other documentation states that both DTDs and Schema are treated the same
way by 
the DOMParser so we could also assume that these grammar definitions should
be 
represented in either case.  If the previous predicates are true then there
should be 
some standard way of  accessing grammars based on both DTD or Schema.  I
can't 
seem to find any methodology that isn't a terrible and literal hack to get
at the Grammar.  
This has been a recurring theme as Grammar access allows for the maintenance
of 
structure and business rules in one easily configurable point, ( i.e. the
DTD or Schema).  
I know that Grammar Access has been discussed on the dev list but it would
be great 
to have a definitive statement about the existing codebase from the Xerces
developers. 
Chris Halverson
Christopher R. Halverson
nCube
chalvers@ncube.com
"Never underestimate the ability of any human to delude themselves,"
"and convince others their delusion is absolute"






Re: Request for Definitive Grammar Access response from Xerces Developers

Posted by Andy Clark <an...@apache.org>.
Chris,

Elena Litani wrote:
> The "Content Models"  (DOM Level 3 working draft)  specifically
> addresses the issue of accessing grammar in memory, as well as 
> modifying it. 

As Elena states, DOM Level 3 will incorporate grammar access
capability. Does the early draft specification support the
kinds of features you need?

We plan to support that feature in DOM Level 3 when it is
ready. And that's the main reason why we have held off adding
a proprietary solution to this problem.

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org

Re: Request for Definitive Grammar Access response from Xerces Developers

Posted by Elena Litani <hl...@jtcsv.com>.
Hi, Chris,
DOM Level 2 APIs do not provide any grammar access. 
Therefore, in Xerces you can't access grammar. We do, of course, store
grammar in memory using some "hidden" structure..

The "Content Models"  (DOM Level 3 working draft)  specifically
addresses the issue of accessing grammar in memory, as well as modifying
it. However, it is ongoing work... and this is too early to implement
it.

Hope it answers your question,
Elena

> Chris Halverson wrote:
> 
> Perhaps one of the Xerces Developers can provide definitive feedback
> for the
> ongoing thread regarding Grammar access. I know that the
> DocumentTypeImpl is not
> a representation of the DTD, however it does have methods indicating
> that you can access
> the grammar that don't work. The below statement ( taken from the
> DocumentTypeImpl
> API docs Xerces 1.2.3 ) implies that the grammar for a parsed document
> actually does
> reside in the Document Object, but without any parent object or
> accessor path as
> "their appropriate NamedNodeMaps"  would appear to be hidden.
> Excert from DocumentTypeImpl API Docs
> This class represents a Document Type declaraction in the document
> itself, not a Document Type Definition (DTD). An XML document may (or
> may not) have such a reference.
> 
> DocumentType is an Extended DOM feature, used in XML documents but not
> in HTML.
> Note that Entities and Notations are no longer children of the
> DocumentType, but are parentless nodes hung only in their appropriate
> NamedNodeMaps.
> 
> Other documentation states that both DTDs and Schema are treated the
> same way by
> the DOMParser so we could also assume that these grammar definitions
> should be
> represented in either case.  If the previous predicates are true then
> there should be
> some standard way of  accessing grammars based on both DTD or Schema.
> I can't
> seem to find any methodology that isn't a terrible and literal hack to
> get at the Grammar.
> This has been a recurring theme as Grammar access allows for the
> maintenance of
> structure and business rules in one easily configurable point, ( i.e.
> the DTD or Schema).
> I know that Grammar Access has been discussed on the dev list but it
> would be great
> to have a definitive statement about the existing codebase from the
> Xerces developers.
> Chris Halverson
> Christopher R. Halverson
> nCube
> chalvers@ncube.com
> "Never underestimate the ability of any human to delude themselves,"
> "and convince others their delusion is absolute"