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; %lcInteractionBase2;)*" > The constraints I'm generating redeclare this as e.g.: <!ENTITY % lcInteraction.content "(%lcInteractionBase;)*" > 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 non-trivial.). The fix is to declare the %lcInteractionBase2; parameter entity with empty replacement text in the constraint module, e.g.: <!ENTITY % lcInteractionBase "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). Cheers, Eliot ————— Eliot Kimber, Owner Contrext, LLC
http://contrext.com