R
Razvan
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)
<picicture pictype="jpeg"> ... </picicture>
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.
<picicture pictype="jpeg"> ... </picicture>
Confused? You have to write it as follows because it's a QName.
<picicture pictype="pic:jpeg"> ... </picicture>
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
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)
<picicture pictype="jpeg"> ... </picicture>
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.
<picicture pictype="jpeg"> ... </picicture>
Confused? You have to write it as follows because it's a QName.
<picicture pictype="pic:jpeg"> ... </picicture>
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