Hi,
i'm doing a small research on Xerces-J.
i have questions related to some variables and methods in DTDGrammar.
Question #1
(about array 'fElementDeclIsExternal', 'fAttributeDeclIsExternal', and
'fEntityInExternal').
The information contained in array 'fElementDeclIsExternal', 'fAttributeDeclIsExternal',
and 'fEntityInExternal' in DTDGrammar
is used by XMLDTDValidator to check whether a markup is considered as
external markup declaration (in VC Standalone Document Declaration checking).
Here's the definition of external markup declarations :
" An external markup declaration is defined as a
markup declaration occurring in the external subset or
in a parameter entity."
So in order for these arrays ('fElementDeclIsExternal', 'fAttributeDeclIsExternal', and
'fEntityInExternal') to be used correctly by XMLDTDValidator,
they must contain information of whether the
markup-declaration they represent occurs in external subset or
in a parameter entity.
But those arrays only contain information of whether the
markup-declaration they represent occurs in external subset.
This is because they are initialized by variable 'fReadingExternalDTD', which
saves only the status of whether the DTD-subset being scanned is
internal-DTD-subset or external-DTD-subset.
So those arrays doesn't yet contain information of whether the
markup-declaration they represent occurs in parameter-entity.
Can I obtain follow-ups at this point ?
Question #2
(about the implementation of method startParameterEntity()).
I found that the steps done in method 'startParameterEntity()' in
DTDGrammar is not necessary.
It tries to push variable 'fReadingExternalDTD' to stack 'fPEntityStack',
in order to keep track of the 'fReadingExternalDTD'-status
of each parameter-entity.
I think that this step is not necessary, because variable
'fReadingExternalDTD' don't change no matter how deep the nesting of
a parameter-entity is. Variable 'fReadingExternalDTD' is only changed when
we switch from internal-DTD-subset to external-DTD-subset. So it is not needed
to be saved to 'fPEntityStack'.
Taken for conclusion, there's no need to keep track of the 'fReadingExternalDTD'-status
of each parameter-entity (i.e. there's no need to
push variable 'fReadingExternalDTD' to stack 'fPEntityStack',
as is done inside method startParameterEntity()).
So we are save to remove this step, and also the step done in method
endParameterEntity(), which is the inverse of that in startParameterEntity().
Am i right at this point ?
Thank you,
Do you Yahoo!?
Y! Messenger - Communicate in real time. Download now.
