[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

NOTATION Example (was Re: Binary Data in XML)

  • From: "James Tauber" <jtauber@j...>
  • To: <xml-dev@i...>
  • Date: Thu, 1 Oct 1998 03:29:43 +0800

xml notation example
-----Original Message-----
From: Peter Murray-Rust <peter@u...>
>I know that this can also be done using NOTATION but also that - like many
>others - I don't know how to do it and have never seen a NOTATION used in
>XML documents.

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@j...      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/


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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.