W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2005

Entity workaround for extending an enumerated list via redefine

From: Hirtle, David <David.Hirtle@nrc-cnrc.gc.ca>
Date: Fri, 4 Mar 2005 12:23:38 -0500
Message-ID: <10C94843061E094A98C02EB77CFC328712856E85@nrcmrdex1d.imsb.nrc.ca>
To: xmlschema-dev@w3.org

I need to define an attribute

<xs:attribute name="innerclose" use="optional">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="universal"/>

and later extend the enumerated type to include

<xs:enumeration value="existential"/>

via <redefine>.

Now, I realize that extending an enumerated list with <redefine> isn't
possible. But digging through the mailing list archives, I see that a
work-around involving entities was mentioned back in 2003 (and later
confirmed by Henry Thompson):

My question is this: can this work-around be modified to work with redefine?
In http://www.ruleml.org/0.89/xsd/modules/connective_module.xsd, I added a
general entity declaration (which is initially empty) to the top of the
as well as a reference to the entity (called innerclose-universal) where the
enumeration needs to be extended:

<!DOCTYPE xs:schema [
<!ENTITY innerclose-universal ''>


<xs:attribute name="innerclose" use="optional">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="universal"/>

Now in the redefining schema (http://www.ruleml.org/0.89/xsd/folog.xsd), I
to overwrite the value of the empty entity with an additional enumeration:

<!DOCTYPE xs:schema [
<!ENTITY innerclose-universal '<xs:enumeration value="existential"/>'>

However, this doesn't seem to work with either Saxon-SA 8.3	or the
current XSV (results
below), e.g. when trying to validate
Is this a matter of not being able to overwrite general entities?  (If so,
there must
be another way to accomplish this.)  It doesn't appear as though the entity
is being
expanded by the XML parser before the validation is taking place.

Am I missing something?





Validation error on line 10 column 32 of
Invalid value {existential}. Value "existential" violates the enumeration
"universal" of the type of attribute innerclose


<invalid char="2" code="cvc-attribute.1.2" line="10"
 resource="http://www.ruleml.org/0.89/exa/folog.ruleml">attribute type
 check failed for {None}:innerclose: existential not in enumeration
Received on Friday, 4 March 2005 17:24:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:07 UTC