Why namespaces?

Paul Prescod paul at prescod.net
Wed Sep 1 15:05:26 BST 1999

David Brownell wrote:
> > Second, note that an XHTML browser *does* need to worry about what
> > variant of HTML was used. The browser must decide which of its implicit
> > stylesheets to apply. Each stylesheet has hard-coded knowledge of
> > content models embedded within it. With HTML this is not a big deal
> > because we have become used to presuming that all HTML will be "loose".
> Perhaps you could clarify this for me:  why would an XHTML content
> model imply a stylsheet?  The need doesn't naturally follow; maybe I
> missed something in one of the hundreds of earlier messages!  Code
> handling the "frameset" model handles "transitional" and "strict" as
> simple subsets -- right?

But not vice versa. A program written for strict will not work with a
frameset or transitional document.

If the validation layer sees two things as distinct then any layer built
on top of the validation layer should continue to see them as distinct.
To me that is a no-brainer. In this case the validation layer sees
htmlloose:P and htmlstrict:P as completely different documents. To the
validator they are as distinct as Docbook:article and xsl:stylesheet!

> > In general, as a model, we should adhere to your model strictly: the
> > browser should see only level 2. Level 2 validation should be driven by
> > the unique names in level 1.
> Now you're bringing validation into this.  

That's because validation is vital. It's central to the whole thing. An
application author can only write code that assumes the data has been
validated and has passed. If you presume that any mix of HTML tags is
equally likely to appear in the input then you are back to the legacy
HTML tag soup.

> Browsers validating?  Hmm.
> It's mandatory neither in XML nor in XHTML.  

Whether or not some computer code does the validation is irrelevant. The
concept of validity is central to XHTML and to almost every application
built on top of it. David Megginson mentioned one of a very few
exceptions: a search engine. But the vast majority of applications will
make many assumptions about the input data based on the presumption that
the input *will be valid*. Without that you have nothing.

This is the central point. The namespace specification says that
validity is irrelevant and at that level they are right. But at the
application level it is NOT irrelevant -- it is the foundation of
everything else. Whether the actual validation occurs on the client side
or the server side doesn't matter. Whether it was done in code or in
someone's head doesn't matter. The whole system depends on the fact that
it has been done. 

Therefore if the validator sees two elements as distinct then the
application needs to know that so it can know what input structure it
should expect.

> I really don't see why the parse tree would need to expose content
> models, particularly in the case of the render-only application you
> describe.

How can you write a stylesheet that makes no assumptions about the
structure and hierarchy of the data? It's impossible.

 Paul Prescod

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at 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 at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)

More information about the Xml-dev mailing list