RE: Using of DTD entities in XML schema

Look into substitution groups -- you could use the identify types, and have
different names.
 
key_equivalenceClass[Definition:]  Through the new mechanism of element
substitution groups, XML Schemas provides a more powerful model supporting
substitution of one named element for another. Any top-level element
declaration can serve as the defining element, or head, for an element
substitution group. Other top-level element declarations, regardless of
target namespace, can be designated as members of the substitution group
headed by this element. In a suitably enabled content model, a reference to
the head  <http://www.w3.org/TR/xmlschema-1/#key-vn> ·validates· not just
the head itself, but elements corresponding to any member of the
substitution group as well. 

-----Original Message-----
From: Michael Fishman [mailto:mikefishman@hotmail.com]
Sent: Monday, October 29, 2001 1:56 PM
To: xmlschema-dev@w3.org
Subject: Using of DTD entities in XML schema


Hi everybody,
I am kind of new in XML schemas and asking for your advice.
We were using DTD in our XML API for some time. To make XML tags naming
separate and more fl;exible the idea was:
- Use 2 set of XML names: long (user) names and short (internal). These
names have been stored in an Excel spreadsheet and converted to an entity
file that looked like that: 
====================================================
<!ENTITY % Zn_cd "ZoneCode">
<!ENTITY % Zn_Desc "ZoneDescription">
<!ENTITY % Zone "Zone">
<!ENTITY % HubRgn_Grp_cd "HubRegionZoneGroupCode">
<!ENTITY % CsldArea_Grp_cd "ConsolidationAreaZoneGroupCode">
<!ENTITY % GLRgn_Grp_cd "GLRegionZoneGroupCode">
<!ENTITY % TaxRgn_Grp_cd "TaxRegionZoneGroupCode">

====================================================
which mapped user's and internal names and this file was included in DTDs.
This way we could easily switch between different languages, etc.
The very simplified example of our DTDs is here:
====================================================
<!ENTITY % Zn_cd "ZoneCode">
<!ENTITY % Zn_Desc "ZoneDescription">
<!ENTITY % Zone "Zone">
<!ENTITY % HubRgn_Grp_cd "HubRegionZoneGroupCode">
<!ENTITY % CsldArea_Grp_cd "ConsolidationAreaZoneGroupCode">
<!ENTITY % GLRgn_Grp_cd "GLRegionZoneGroupCode">
<!ENTITY % TaxRgn_Grp_cd "TaxRegionZoneGroupCode">
 
<!ENTITY % X_ZONECODE "Length CDATA #FIXED '8' Case CDATA #FIXED 'Upper' ">
 
<!ENTITY % X_NAME "Length CDATA #FIXED '70' Truncate CDATA #FIXED 'Allowed'
">
 
<!ENTITY % X_ZONEGRP_CODE "Length CDATA #FIXED '12' Case CDATA #FIXED
'Upper' ">
 
<!ENTITY % vbool "bFALSE|bTRUE|bNULL">

<!ELEMENT %Zn_cd;  (#PCDATA )>
<!ATTLIST %Zn_cd;  %X_ZONECODE; >
 
<!ELEMENT %Zn_Desc;  (#PCDATA )>
<!ATTLIST %Zn_Desc;  %X_NAME; >
 
<!ELEMENT %HubRgn_Grp_cd;  (#PCDATA )>
<!ATTLIST %HubRgn_Grp_cd;  %X_ZONEGRP_CODE; >
 
<!ELEMENT %CsldArea_Grp_cd;  (#PCDATA )>
<!ATTLIST %CsldArea_Grp_cd;  %X_ZONEGRP_CODE; >
 
<!ELEMENT %GLRgn_Grp_cd;  (#PCDATA )>
<!ATTLIST %GLRgn_Grp_cd;  %X_ZONEGRP_CODE; >
 
<!ELEMENT %TaxRgn_Grp_cd;  (#PCDATA )>
<!ATTLIST %TaxRgn_Grp_cd;  %X_ZONEGRP_CODE; >
 
<!ELEMENT %Zone; ( (%Zn_cd;)?, (%Zn_Desc;)?, (%HubRgn_Grp_cd;)?,
(%CsldArea_Grp_cd;)?, (%GLRgn_Grp_cd;)?, (%TaxRgn_Grp_cd;)? ) >
====================================================
Now, I don't know how to execute similar trick with this long-short names
substitution with XML schemas and would appreciate any help.
 
Thnks,
Mike Fishman

Received on Tuesday, 30 October 2001 11:10:00 UTC