W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Using of DTD entities in XML schema

From: Michael Fishman <mikefishman@hotmail.com>
Date: Mon, 29 Oct 2001 13:56:23 -0500 (EST)
To: <xmlschema-dev@w3.org>
Message-ID: <OE34iLbaazvJjeC9X6s000176e4@hotmail.com>
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 Monday, 29 October 2001 17:19:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:24 GMT