[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Namespaces in XML and schemas


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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.