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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: XML in the real world... Was "Re: Another look at namespaces"

[ Lists Home | Date Index | Thread Index ]
  • From: David Carlisle <davidc@nag.co.uk>
  • To: ann@webgeek.com
  • Date: Fri, 17 Sep 1999 15:19:26 +0100 (BST)


Ann

> It's assertions like this that honestly confuse me. WWW content,rendered on
> today's HTML browsers, cares not a whit about namespaces, so how does
> having 3 complicate your life more than 1? We effectively have "0" since
> the browsers don't use, acknowledge, or appreciate the namespace. 

Browsers today might not, but IE5 which is essentially namespace aware
would have cared except that I understand that it hard codes html:
(but given there wasn't (isn't) an official namespace for html this
is at least forgivable)

But if you have (as surely you will soon) a namespace aware browser
and want to say something like

top level HTML h1 elements should be rendered bold

 but you don't want to affect other elements not related to html that
just happen to be called h1 then with the one namespace case (using xslt
syntax but that isn't really the point here) you just associate html:
with the html namespace (or make that namespace the default) and then go
<xsl:template match="html:h1"> (or <xsl:template match="h1">) ...  in
either case this styling works for current and future flavours of HTML.
In the multiple namespace case it is really far more technical to write
a match that will find any element with local name h1 and namespace URI
beginning with a certain string.

It is not just for styling, if I want to index all top level section
elements I want to find all html h1 elements but not hit h1 elements
from some unrelated language.

the xpath expression "html:h1" (assuming xmlns:html has been suitably
declared somewhere) gets me exactly what I want in the one namespace
case. If you believe having separate namespaces for the three current
flavours and another one, xhtml1.1 on the way, is better, then please
write down the xpath expression to locate titles in HTML documents and
then try to convince us that it is better.
Something like 
"*[starts-with(namespace(.),'http://www.w3.org/xxxx') and local-name(.)='h1']"
instead of
"html:h1"

Now perhaps you will just say it looks bad because the xpath syntax is
odd but I don't think that is the reason. The reason is that in order to
re-enforce the mechanisms (doctype) that an authoring tool has to guide
an HTML author into the a particular flavour of HTML you are suggesting
that you tell every XML namespace aware application that a frameset h1
is completely different from a transitional h1 which is completely
different from an xhtml 1.1 h1. This just will confuse everybody to the
point of breaking the entire system. No one will understand why they have
to use the above to access HTML h1 elements, when it is `clear' that
an html h1 is essentially the same thing in all flavours of html.
That's why they are all called h1, and why the flavours are all called
(x)html. That's why there should be one namespace.


David
PS
Using `flavour' because `dialect' appears too contentious:-) Use flavor
(I think?) if your dialect of English is different.

 

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