Re: Doctype, namespace etc.

In <049601c1f7fa$ef250530$390573d5@mmstudioproj>, "Sigurd Lerstad"
<sigler@bredband.no> wrote:

| When using a [doctype declaration] inside an xml document, it points 
| to the url of a dtd, 

Actually, it doesn't.  The DTD is the effective contents of the doctype
declaration.  The URL in question (when present) is that of an "external
subset" whose contents are to be included (at the end) in the process of
assembling the DTD.  

However, external subsets are optional in doctype declarations.  So your
premise, that there will be a URL, is wrong.

| so it's easy to load generic xml documents,

No easier than without, as a doctype declaration itself is optional.

| but mixing xml from different namespaces is impossible this way? (am I 
| correct)

Most likely, not; this is very confused.  A URL for an external subset
does not establish a "namespace" of any kind, so the issue of "mixing
namespaces" is an entirely separate one. 

| some xml documents only contain namespace declaration like
| 
| <html xmlns="...." >,
| 
| then you know the namespace, but you don't know where the dtd is (or
| schema), or you can have
| 
| <html xsi:schemaLocation="...", then you know the schema location...

Actually, you don't.  The identifier (fragment) 'schemaLocation' has no
independent meaning despite the convenience of plain English parsing by
human intelligence.  The real identifier, to take the XML Namespaces spec
seriously, is the compound for which 'xsi:schemaLocation' is an instance
specific shorthand.  Presumably, the same attribute specification list has
something like xmlns:xsi="http://some.domain.tld/some/path" to klonk you
over the head with the munificence of its immanent meaning, because you,
as a computer program, have no means otherwise to understand that it is
indeed a schema being located.  That is, you must understand the contents
of xmlns:xsi="whatever" *before* you can understand 'xsi:schemaLocation'.

The problem here is that the *concept* of a "schema location" has somehow
become specific to a particular "namespace" - the magical one that these
days gets cargo-culted into a xmlns:xsi attribute.  Suppose you wanted to
describe your schema using RELAX, TREX, RELAX-NG or Schematron or even
your homegrown system.  Will the same technique work?  What, other than
the persuasive force of familiar words, makes foo:schemaLocation point to
a schema using *any* formalism?  See, in this connection:

http://groups.google.com/groups?selm=uah54tcuuebuf51a364n1jq1faufrnmd1r@4ax.com
http://groups.google.com/groups?selm=q1l74tkgf9th47l8ujlecnjjpbmbvon7hj@4ax.com
http://groups.google.com/groups?selm=8f984tspdol3789jrji9eptdtt5cacflje@4ax.com

| Can an xsi:schemaLocation point to a dtd as well as a schema?

It seems that it can point only to a schema in a specific formalism.
 
| If you only have a namespace, does a program have to hardcode the url to 
| the dtd or schema (or have it stored on the harddisk)?

If the XML Namespaces spec were taken seriously, there is no necessary
association between a namespace and a schema, so the answer is: No.
 
| In the case of embedded mathml/svg inside xhtml, how can you validate that
| document against the xhtml dtd? (without getting errors)

For an answer that has been standardized since 1997 (or 1992, depending on
your point of view), see:

http://lists.w3.org/Archives/Public/www-html/2000Jan/0217.html

Received on Thursday, 9 May 2002 22:20:28 UTC