A Permissable use of user defined Entities

Hi Everyone,

This is a reposting of the argument for boilerplate entity text for the 
benefit of the public-i18n-its@w3.org mailing list:

The only place that I have seen entity text used effectively and without 
any problems is in the area of boilerplate text. In this instance the 
boilerplate text is held by Locale, so that depending on the target 
language the appropriate text is selected. Boiler plate text by its very 
nature is used for headings etc. and is linguistically complete - it 
stands alone and does not rely on any surrounding context. The boiler 
plate entities are only ever used within attributes. The composition 
process uses the attribute values to display the appropriate target 
language text:

e.g.

In the following example the DTD is fragmented so that multiple language 
versions can all share the key core components. Only the 
bp_pl-pl_xml.ent defines the language specific boilerplate text:

sample-pl.dtd:
------------------------------------------------------------------
<!ENTITY % conf PUBLIC "-//XML-INTL//ENTITIES pub Conf//EN" "sample.elm">
<!ENTITY % bp PUBLIC "-//XML-INTL//ENTITIES boilerplate XML-INTL//PL-PL" 
"bp_pl-pl_xml.ent">
<!ENTITY % cals PUBLIC "-//XML-INTL//ELEMENTS CALS Table XML//EN" 
"cals-xml.elm">

%conf;
%bp;
%elements;
%cals;

------------------------------------------------------------------

bp_pl-pl_xml.ent:

------------------------------------------------------------------

<!ENTITY locale 'pl-PL'>
<!ENTITY copyright-owner 'XML-INTL Limited, PO Box 2167, Gerrards Cross, 
Bucks SL9 8XF, United Kingdom'>
<!ENTITY copyright-text 'Niniejszy tekst jest własnością intelektualną 
XML-INTL, wszelkie prawa kopiowania tego tekstu są zastrzerzone'>

------------------------------------------------------------------

sample.elm:

------------------------------------------------------------------

<!ELEMENT heading (para+) >
<!ATTLIST heading
         locale         CDATA #FIXED '&locale;'
         copyright-owner CDATA #FIXED '&copyright-owner;'
         copyright-text     CDATA #FIXED '&copyright-text;' >

------------------------------------------------------------------

The key rule regarding the use of user defined entities with regards to 
i18n is NEVER allow entities within ANY PCDATA context where they can 
cause immense problems. You CAN use entities for linguistically complete 
and stand alone text that is used for boilerplate text.

Regards,

AZ
-- 


email - azydron@xml-intl.com
smail - c/o Mr. A.Zydron
 PO Box 2167
         Gerrards Cross
         Bucks SL9 8XF
 United Kingdom
Mobile +(44) 7966 477 181
FAX    +(44) 1753 480 465
www - http://www.xml-intl.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
may not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version. Unless
explicitly stated otherwise this message is provided for informational
purposes only and should not be construed as a solicitation or offer.

Received on Sunday, 10 April 2005 15:13:55 UTC