Thank you very much for your answer.
I need a little time to think about it and I will further comment
Date: Thursday, January
31, 2002 12:11:00 AM
Subject: Re: [xml-dev]
Namespaces in XML and schemas
Laurent Therond wrote:
> This could be a stupid
It definitely isn't.
> "Namespaces in XML"
> Hence, in accordance with
the specification of namespaces, the following
> document (a
stylesheet fragment) is said to be valid (I am not sure if
applies here, in fact.):
I think you are confusing three different
1) Conformance to the namespaces spec. The following
to the namespaces spec.
Technically, this means that a document is valid according
to a DTD.
The following document is not valid because it does not
contain a DTD,
so validity can't be checked. You could write a DTD for
document, but there is no reason to do so, as it wouldn't
other similar (but different) XSLT documents. It is impossible
a DTD that applies to all XSLT documents, since XSLT documents
contain arbitrary elements.
3) Schema validity. This means that a
document is valid according to an
XML Schema. It is (theoretically)
possible to schema-validate only part
of a document. It is also
possible to "laxly" schema-validate documents
or skip parts of
documents altogether during schema validation. These
might be useful
for validating XSLT stylesheets (see below).
Other schema languages
have similar types of validity. The rules vary
according to the
An interesting question here is whether it is possible to
a) A schema (any language) to validate the XSLT parts of an
b) A schema (any language) to validate the
non-XSLT parts of an XSLT
document for a given output type (e.g. the
output of the XSLT schema
must be XHTML).
<snip text="XSLT document" />
> Now, this
is swell and all but an assumed schema for XHTML would not allow
the "xsl:value-of" element as part of the content of the "title"
> Therefore, my questions are:
> 1) Are stylesheets supposed to be valid documents?
> 2) How can one consider the possibility of multischema
> that 2 schemas can conflict with each
Depends what you mean by multi-schema documents:
document, all of which conforms to more than one schema. Although
possible to write an infinite number of schemas that apply to a
document, it would be very rare to do so.
2) A document, parts of
which conform to different schemas. This is more
common, although still
a minority. XML Schemas allows you to define such
schemas to a certain
extent. When you get to the part of the document
outside the current
schema, you simply say, "Anything can go here."
(This works for
children. Does XML Schemas have a way to say, "I can
have any parent,
but I must conform to the following schema?")
3) A document whose
schema has elements/attributes from more than one
namespace. This is
the most common case and is supported by all schema
Namespaces are used to resolve collisions between
> Finally, I am asking these questions because I
would like to define the
> schema of a minimal language that I would
use to create document templates.
> Among other things, this minimal
language would involve elements that are
> not allowed as part of
the content of certain XHTML (for instance)
> elements, but that
must exists as such to provided the desired templating
The short answer is that you won't be able to use
the XHTML schema (for
example) to validate such documents. Whether it
is possible to use the
XHTML schema to partially validate such
documents probably depends on
how you want to use XHTML.