Re: adding a namespace declaration to result stylesheet?

Oliver Becker <[email protected]> Fri, 12 Sep 2003 10:49:44 +0200 (MEST)
Newsgroups gmane.text.xml.schematron
Message-ID <[email protected]>
Hi, an addendum to my last mail:

> My problem is that xs: namespace prefix. Even if I include
> xmlns:xs="http://www.w3.org/2001/XMLSchema" as an attribute of the root,
> there are no elements or attributes in the document from that namespace, [..]

The Schematron skeleton implementation needs a fix.
Replace in <xsl:template match="sch:schema | schema">
the line
	<axsl:stylesheet version="1.0">
with
        <axsl:stylesheet>
            <xsl:copy-of select="namespace::*" />
            <xsl:attribute name="version">2.0</xsl:attribute>

Note: I've also switched to version="2.0" because you want to check
datatypes.

I believe with this <xsl:copy-of select="namespace::*" /> we can even
drop the <ns> element which is clearly just a work-around.

Cheers,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: [email protected]             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf