OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

dita message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Issue With Xerces Parsing of DTDs and L&T Parsing Failures

I have worked out the problem I was having with parsing of the L&T shells
that use a constraint to only reflect one of learning or learning2: Xerces
expands all parameter entity references without determining if those
entity references will ever be used.

In particular, the base declaration for the %learningInteraction.content
parameter entity is:

<!ENTITY % lcInteraction.content
                       "(%lcInteractionBase; |

The constraints I'm generating redeclare this as e.g.:

<!ENTITY % lcInteraction.content

Note the lack of reference to %lcInteractionBase2;.

By the rules of XML, this declaration should completely replace the
original declaration of %lcInteraction.content and therefore the lack of
declaration of the %lcInteractionBase2; parameter entity should not be an
error because the reference would never be expanded in the course of
validating a document.

However, Xerces 2.11 (the latest version) appears to expand the reference
despite the fact that it can never be effective, failing on the
unresolvable parameter entity reference.

While Xerces' behavior is clearly wrong (at most it should be reporting
the undeclared entity as a warning, not a hard-stop failure), we have no
choice but to work around it since Xerces is both ubiquitous and unlikely
to be fixed (I fully expect the response to my bug report on this issue to
either be "working as designed" or "submit a patch and we'll consider
fixing it". I'm sure that correcting the current behavior would be

The fix is to declare the %lcInteractionBase2; parameter entity with empty
replacement text in the constraint module, e.g.:

<!ENTITY % lcInteractionBase
<!ENTITY % lcInteractionBase2                               "">

This satisfies Xerces and and doesn't cause any other problems. However,
it is not required by the XML standard.

I will update the DTD generation process to handle this case (the RNG
constraint already requires a declaration for the lcInteractionBase2
pattern with a value of <empty/> in this case, which is the logical
equivalent of the "" value for the parameter entity).



Eliot Kimber, Owner
Contrext, LLC

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]