XML and case-folding

David Megginson ak117 at freenet.carleton.ca
Sun Nov 16 22:07:39 GMT 1997


I remember some postings recently wondering about the implications of
making elements (etc.) case-sensitive in XML.  I remember only Tim's
followup about IDs -- apologies if I'm going over well-worn ground
here.

As I understand it, if you set both NAMECASE GENERAL and NAMECASE
ENTITY to "NO" in full SGML, then there will be no case substitution
anywhere.  Since XML is an SGML application profile, that means that
you may use

  <!ELEMENT ...>, <!ATTLIST ...>, <!NOTATION ...>, and <!ENTITY ...>

but NOT

  <!Element ...>, <!Attlist ...>, <!Notation ...>, and <!Entity ...>

or

  <!element ...>, <!attlist ...>, <!notation ...>, and <!entity ...>

Furthermore, all element type names, attribute names, notation names,
entity names, _and_ attribute values (of any type) are also case
sensitive.  As a result, if you had this in your XML DTD:

  <!ATTLIST doc
    security   (unclassified|secret) #REQUIRED>

and this in your XML document:

  <doc security="SECRET">

the parser should report an error.  It also means that something like
this is legal (though pathologically wierd):

  <!ATTLIST question
    value (yes|Yes|yEs|yeS|YEs|YeS|yES|YES)>

The contents of processing instructions are never subject to case
substitution anyway, though the validation of their contents is also
mostly beyond (full) SGML's mandate; for consistency, however, it
would make sense to require everything there to be in upper-case as
well.  In other words,

  <?XML VERSION="1.0" ENCODING="ISO-LATIN-1"?>

would be acceptable, but not

  <?Xml version="1.0" encoding="Iso-Latin-1"?>

Any comment on this last point?


All the best,


David

-- 
David Megginson                 ak117 at freenet.carleton.ca
Microstar Software Ltd.         dmeggins at microstar.com
      http://home.sprynet.com/sprynet/dmeggins/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list