OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: XHTML DTDs failing in IE5

[ Lists Home | Date Index | Thread Index ]
  • From: Mark Birbeck <Mark.Birbeck@iedigital.net>
  • To: "'xml-dev@ic.ac.uk'" <xml-dev@ic.ac.uk>
  • Date: Thu, 3 Jun 1999 20:13:25 +0100

Richard Tobin wrote:
> Andrew Layman posted a message about this a couple of weeks ago; it's
> archived as
> http://www.lists.ic.ac.uk/hypermail/xml-dev/xml-dev-May-1999/0394.html
> He points out:
>   if you want to use the DTD to validate an instance, you must use
>   exactly the same prefixes in the instance as were used in the DTD.

Thanks for that Richard - I missed that. However, without raising the
good old namespace debate again ;) - this seems unnecessarily

I can't see how DTDs get involved in namespaces *as such* (or rather how
namespaces get involved in DTDs). I can see how if I want to have two
elements with the same name I can differentiate them with a namespace
prefix, like ns1:elem and ns2:elem. But as far as validation is
concerned, won't the following two examples pass (even in a
non-namespace aware parser)?

<!ELEMENT ns1:elem ns2:elem>
<!ATTLIST ns1:elem
  xmlns:ns1 %URI; #REQUIRED
<!ELEMENT ns2:elem (#PCDATA)>
<!ATTLIST ns2:elem
  xmlns:ns2 %URI; #REQUIRED

XML 1:
<ns1:elem xmlns:ns1="uri:namespace1">
    <ns2:elem xmlns:ns2="uri:namespace2">Hello mum</ns2:elem>

XML 2:
<ns1:elem xmlns:ns1="uri:namespace3">
    <ns2:elem xmlns:ns2="uri:namespace4">Hello mum</ns2:elem>

If I understand Andrew correctly then this is what he means when he says
you "must use exactly the same prefixes" - the ns1 and ns2. But why does
this mean that the value of 'xmlns' has to be #FIXED? Surely at the
level of validation it doesn't matter what the namespace value is - and
it's debatable as to whether the concept of namespaces even exists at
the level of validation as currently understood, with XML 1.0 +
namespaces (XML-Data is different, see below).

So, my question is, have MS made something part of validation (as
currently defined) which doesn't belong there? If an application really
must have the correct namespace defined for it to process the data
correctly (after parsing) then it always has the option of defining a
DTD that says the namespace must be set to this value. In my above
example this could be:

<!ELEMENT ns1:elem ns2:elem>
<!ATTLIST ns1:elem
  xmlns:ns1 %URI; #FIXED "uri:namespace1"
<!ELEMENT ns2:elem (#PCDATA)>
<!ATTLIST ns2:elem
  xmlns:ns2 %URI; #FIXED "uri:namespace2"

and then 'XML 2' would correctly fail. But shouldn't this be an option,
not a requirement? The alternative is to say that one DTD is always
bound to one namespace. For example, the MS version would prevent me

<!ELEMENT elemList (ns1:elem)+>
<!ELEMENT ns1:elem ns2:elem>
<!ATTLIST ns1:elem
  xmlns:ns1 %URI; #REQUIRED
<!ELEMENT ns2:elem (#PCDATA)>
<!ATTLIST ns2:elem
  xmlns:ns2 %URI; #REQUIRED
  <!-- new feature added but old data is still OK -->
  checksum  #CDATA #IMPLIED

    <ns1:elem xmlns:ns1="uri:from version 1">
        <ns2:elem xmlns:ns2="uri:from version 1">Hello mum</ns2:elem>
    <ns1:elem xmlns:ns1="uri:from version 2">
        <ns2:elem xmlns:ns2="uri:from version 2" checksum="10">
            Hello mum

which uses the same DTD to validate two lots of data, but indicates that
they are to be processed (after parsing) in a different way. As far as I
can see from XML 1.0 and the namespace spec this is perfectly

To bring it back to XHTML, if the W3C is saying that any XHTML
processing tool such as a browser needs the namespace set correctly so
that it can pick out the correct bits of the document, then yes, the
'xmlns' value must be #FIXED. But if I want to say, here is a document
that has a namespace, and although that namespace might change as I
develop my applications, a document that uses a previous version of the
namespace should still be valid

By the way, I recognise that none of what I have said applies to
Microsoft's first-cut of schemas constructed from XML which is part of
the IE5 parser. In this case the prefix is genuinely a place-holder and
the actual underlying URI is significant. But in that case they have
implemented 'proper' namespace support in validation, i.e. all the
following documents are effectively the same:

<ns1:elem xmlns:ns1="x-schema:schema1">
    <ns2:elem xmlns:ns2="x-schema:schema2">Hello mum</ns2:elem>


<elem xmlns="x-schema:schema1">
    <ns2:elem xmlns:ns2="x-schema:schema2">Hello mum</ns2:elem>


<ns9000:elem xmlns:ns9000="x-schema:schema1">
    <elem xmlns="x-schema:schema2">Hello mum</elem>

Maybe that's the root of the problem - that features from the schema
type of validation have crept into the DTD type? Any thoughts?



PS In the meantime, what are people doing to get round this? Does no-one
use any of the W3C DTDs with the MS parser? Do you just use different
parsers or have you all copied the DTDs locally and edited them?

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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS