Here is what the C++ version looks like. Given a validator its:
NameIdPoolEnumerator<DTDElementDecl> elemEnum =
valToUse->getElemEnumerator();
while (elemEnum.hasMoreElements())
{
}
Of course we use templates because that's the C++ way, but basicaly we just
ask the validator for an enumerator for the elements, or attribute lists,
etc...
----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]
Andy Clark <[EMAIL PROTECTED]> on 01/25/2000 08:17:13 PM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: Re: getElemEnumerator method in xerces-j
Praki Prakash wrote:
>
> I am trying to get DTD information in Xerces-Java 1.0.1 and following
> EnumVal sample from Xerces-C. I don't see any way to get the element
> declaration pool (getElemEnumerator method) from DTDValidator. Most of
> the methods in DTDValidator take element declaration index and I did not
> see anything obvious that would map an element name to its index in the
> pool. Can somebody shed some light on this? Some sample code would be
> helpful.
You are correct, and this should be fixed. We need to have
some kind of iterator on all of the various pools so that you
can query their contents. For example, asking the ElementDecl-
Pool what elements are defined.
However, the element type is the same as the element name ID
used in the StringPool. So you can use that to get the element
index and all of the other methods in the pool take *that*
identifier.
Does anybody have a suggestion for what the iterator of the
various pools should look like?
--
Andy Clark * IBM, JTC - Silicon Valley * [EMAIL PROTECTED]