Why you should avoid Notation Declarations

Discussion in 'XML' started by Razvan, Feb 22, 2005.

  1. Razvan

    Razvan Guest

    Hi,




    In an article by Mr. Kohsuke Kawaguchi found at:

    http://www.xml.com/pub/a/2001/06/06/schemasimple.html?page=2

    he explains why notations should be avoided. The following XML Schema
    is provided:


    <xsd:notation name="jpeg" public="image/jpeg" system="viewer.exe" />

    <xsd:element name="picture2">
    <xsd:complexType>
    <xsd:simpleContent>
    <xsd:extension base="xsd:hexBinary">
    <xsd:attribute name="pictype">
    <xsd:simpleType>
    <xsd:restriction base="xsd:NOTATION">
    <xsd:enumeration value="jpeg"/>
    <xsd:enumeration value="png"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:attribute>
    </xsd:extension>
    </xsd:simpleContent>
    </xsd:complexType>
    </xsd:element>


    The following XML is OK:

    <picture pictype="jpeg"> ... </picture>

    and so is this: (I tested with XML Spy 2005 and XSV 2.8-1)

    <pic:picture pictype="jpeg"> ... </pic:picture>

    but the author says that the later form is invalid:

    "
    But the following fragment is not valid even if the prefix "pic" is
    properly
    declared.
    <pic:picture pictype="jpeg"> ... </pic:picture>
    Confused? You have to write it as follows because it's a QName.
    <pic:picture pictype="pic:jpeg"> ... </pic:picture>
    Apparently it fails to serve its only reason for existing. There's
    really no
    reason to use notations. Notations are for SGML.
    "

    Can somebody explain why notations are bad and they should be avoided
    ?



    Regards,
    Razvan
     
    Razvan, Feb 22, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    922
    Mark Rae
    Dec 21, 2006
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,077
    Smokey Grindel
    Dec 2, 2006
  3. Grey Squirrel

    Hungarian Notation Vs. Pascal Notation?

    Grey Squirrel, Mar 19, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    1,338
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Mar 21, 2007
  4. Tameem
    Replies:
    454
    Views:
    12,244
  5. Robert Mark Bram

    Dot notation V Bracket notation

    Robert Mark Bram, Jul 4, 2003, in forum: Javascript
    Replies:
    3
    Views:
    475
    Robert Mark Bram
    Jul 5, 2003
Loading...

Share This Page