Namespaces in XML and schemas

Hi,

This could be a stupid question, but I will chance it anyway because I have 
a hard time finding a clear answer...

"Namespaces in XML" states:

We envision applications of Extensible Markup Language (XML) where a single 
XML document may contain elements and attributes (here referred to as a 
"markup vocabulary") that are defined for and used by multiple software 
modules. One motivation for this is modularity; if such a markup vocabulary 
exists which is well-understood and for which there is useful software 
available, it is better to re-use this markup rather than re-invent it.
Such documents, containing multiple markup vocabularies, pose problems of 
recognition and collision. Software modules need to be able to recognize 
the tags and attributes which they are designed to process, even in the 
face of "collisions" occurring when markup intended for some other software 
package uses the same element type or attribute name.

Hence, in accordance with the specification of namespaces, the following 
document (a stylesheet fragment) is said to be valid (I am not sure if 
"valid" applies here, in fact.):

<xsl:stylesheet version="1.1"
                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns="http://www.w3.org/TR/xhtml1">

<xsl:strip-space elements="doc chapter section"/>
<xsl:output
    method="xml"
    indent="yes"
    encoding="iso-8859-1"
/>

<xsl:template match="doc">
  <html>
    <head>
      <title>
        <xsl:value-of select="title"/>
      </title>
    </head>
    <body>
      <xsl:apply-templates/>
    </body>
  </html>
</xsl:template>

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" element.

Therefore, my questions are:

1) Are stylesheets supposed to be valid documents?
2) How can one consider the possibility of multischema documents, granted 
that 2 schemas can conflict with each other?

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 
functionality.

Thank you for your attention.

Regards,

Laurent

Received on Wednesday, 30 January 2002 11:49:08 UTC