[namespaceDocument-8] Re: Namespace dispatching

Paul Prescod wrote:
>
> So I find an XML document at my desk. Where do I find the regular
> expression to figure out its type. I'm trying to make XML documents
> *self-descriptive*.
>

I posed a similar question on XML-DEV last month in an attempt to get people
to focus on what 'document type' might mean in a practical sense:
http://lists.xml.org/archives/xml-dev/200201/msg01355.html

The most compelling answer is that when an XML document lands on your desk,
you probably have an idea of what to do with it.  In any case I might use
any and all of the aforementioned pieces of information in deciding what to
do. Clearly the root element namespace is the most important link to find
out some useful information. On following it, I hope that I would find
something to read describing the namespace.

On the other hand, suppose I find an embedded <xslt:value-of > element
within an XHTML document. On following _that_ namespace URI I might read
that such a document can be interpreted as an XSLT stylesheet. The relevent
_pattern_ would be: *//xslt:* -- roughly: any well formed document with an
embedded XSLT element may be interpreted as a stylesheet.

This comes down to pattern matching, and regular expressions are patterns.

Can this ever be done in an automated fashion? Perhaps, but that would be a
research project. _Today_ a smart person could sit down with the revelent
namespace documents and with a little luck, figure it out. That is to say:
you know the pattern when you see it.

Jonathan

Received on Wednesday, 20 February 2002 22:29:34 UTC