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 Ken Rawlings <kr...@yahoo.com> on 2001/01/14 15:24:39 UTC

Re: Progress on getting RevalidatingDOMParser running under 1.2.0]

Hi,
	
Thanks! Unfortunately, over the holidays I was somewhat limited on time,
but recently have been able to spend a fair amount of time with the parser
and wanted to to pass along an update on getting the RevalidatingDOMParser
up and running again under 1.2. Unfortunately, i'm not used to working
with the parser's internals, so there's quite a bit that's still eluding
me. However, I do have the parser in a compilable form now and it does
seem to be correctly navigating the tree for the validation, although the
calls to checkContent are failing with "org.xml.sax.SAXParseException:
Element type "null" must be declared"

The current code is at: 
http://www.vervet.com/~krawling/RevalidatingDOMParser.java

The basic issue i'm running into now is that I have the element name
index(from stringPool.addSymbol(node.getNodeName())) for the current
element that needs to  be validated, and somehow that needs to be turned 
into the correct element declaration  index to pass to
XMLValidator.checkContent(). I gather from your response and reading the
source that I need to use one of the following methods from Grammar:

public int getElementDeclIndex(int localpartIndex, int scopeIndex) 
public int getElementDeclIndex(int uriIndex, int localpartIndex, int
scopeIndex) 
public int getElementDeclIndex(QName element, int scopeIndex) 

In particular, the first looks promising, and I assume I can use the
element name index I have, but it's unclear what the scopeIndex should be,
or where it should come from. Am I on the right track, and if so, any
ideas?

Thanks,
Ken Rawlings

--- Andy Clark <an...@apache.org> wrote:
> Ken wrote:
> > A couple questions if you have a moment:
> > * XMLValidator.checkContent() is now private -- is it safe to make it
> > public so it can be called from the RevalidatingDOMParser class? 
> > * Is it still safe to call checkContent() repeatedly after the inital
> > parse has been done and modifications to the DOM tree are made?
> > * What did StringPool.getDeclaration() do under the old parser? What
> is
> > the equivalent functionality under 1.2.0?
> 
> If you're willing to work on getting RevalidatingDOMParser up
> and running again, I'll do whatever is needed for you. Because
> we've had complaints about the RevalidatingDOMParser being in
> the package even though it's not functioning, Jeff already
> removed it from the repository. However, once you get it 
> working again, we can put it back into the repository.
> 
> The XMLValidator#checkContent method can be made public if
> you want. Just keep working on the RevalidatingDOMParser by
> making local changes. Then, once you get it working we'll
> make all of the changes in CVS needed to integrate it back
> into Xerces.
> 
> The StringPool#getDeclaration method was used to keep an
> association between an element's name (which was a symbol
> index into the string pool) and the element declaration info
> for that element in the XMLValidator. In the current version,
> we've moved that information out of the validator and into
> a grammar object. Therefore, the string pool doesn't need to
> keep that association anymore. 
> 
> There are methods on the Grammar object that allows you to
> look up an element declaration by using the element's name.
> Check out the public API on Grammar for more information.
> Basically, you use the element name index in order to get 
> the element declaration index which can then be used to
> query information about the element declaration. One hint:
> top level element declarations have a scope of -1. That
> should be enough information to get you on your way.
> 
> -- 
> Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/