L
Ludovic Kuty
Dear group,
In the article entitled "Namespace Myths Exploded" ( http://www.xml.com/lpt/a/395 ), there is something (in fact a few things but let's focus on this one thing) that bothers me. In Myth 2 called "Universal names uniquely identify element types and attributes" we have a code sample :
<?xml version="1.0" ?>
<A xmlns="http://www.foo.org/">
<A>abcd</A>
</A>
And the associated question in the text : "Do these share a single element type or do they have two different element types?". I don't understand. I thought that the DTD will constrain the element A by telling us what is acceptable as attributes and what is acceptable as content. Once it is done, how could we get two element types ? I mean A should/could be defined as :
<!ELEMENT A (#PCDATA | A)>
<!ATTLIST A xmlns CDATA #IMPLIED>
For me, it is just one type, not two. How could we get two different element types with the same name ? I understand that it "could" be possible to distinguish them based on the context but I don't think DTDs or W3C XML Schemas allow this. Could someone enlighten me on this matter ?
Also, I would be interested in any ressource (book, article, Web page, ...)that talks about "element types" and not just "elements" and that is quiteformal about XML. You may point me to the right location in the XML recommendation.
TIA,
Ludovic Kuty
In the article entitled "Namespace Myths Exploded" ( http://www.xml.com/lpt/a/395 ), there is something (in fact a few things but let's focus on this one thing) that bothers me. In Myth 2 called "Universal names uniquely identify element types and attributes" we have a code sample :
<?xml version="1.0" ?>
<A xmlns="http://www.foo.org/">
<A>abcd</A>
</A>
And the associated question in the text : "Do these share a single element type or do they have two different element types?". I don't understand. I thought that the DTD will constrain the element A by telling us what is acceptable as attributes and what is acceptable as content. Once it is done, how could we get two element types ? I mean A should/could be defined as :
<!ELEMENT A (#PCDATA | A)>
<!ATTLIST A xmlns CDATA #IMPLIED>
For me, it is just one type, not two. How could we get two different element types with the same name ? I understand that it "could" be possible to distinguish them based on the context but I don't think DTDs or W3C XML Schemas allow this. Could someone enlighten me on this matter ?
Also, I would be interested in any ressource (book, article, Web page, ...)that talks about "element types" and not just "elements" and that is quiteformal about XML. You may point me to the right location in the XML recommendation.
TIA,
Ludovic Kuty