Here is an example based on one from my XML course. Note that attributes are
just one use of notations, others are unparsed entities and PI targets which
I can also give examples of if anyone would like.
Say you want a different notation for US dates, Australian dates and ISO
dates.
First of all the declaration:
<!NOTATION USDATE SYSTEM "http://www.schema.net/usdate.not">
<!NOTATION AUSDATE SYSTEM "http://www.schema.net/ausdate.not">
<!NOTATION ISODATE SYSTEM "http://www.schema.net/isodate.not">
Then if an element type is to use this notation, we declare a notation
attribute:
<!ATTLIST DATE
FORMAT NOTATION (USDATE|AUSDATE|ISODATE) "ISODATE")
Then we can use:
<DATE>19980414</DATE>
<DATE FORMAT="ISODATE">19980414</DATE>
<DATE FORMAT="AUSDATE">14/4/1998</DATE>
<DATE FORMAT="USDATE">4/14/1998</DATE>
in our documents and the notation identified by the system identifier in the
NOTATION declarations will be associated with the content of the elements
and a parser provides this information for the application.
James
-- James Tauber / jtauber@jtauber.com http://www.jtauber.com/ Lecturer and Associate Researcher Electronic Commerce Network ( http://www.xmlinfo.com/ Curtin Business School ( http://www.xmlsoftware.com/ Perth, Western Australia ( http://www.schema.net/