RE: adding a namespace declaration to result stylesheet?

Oliver Becker <[email protected]> Mon, 15 Sep 2003 16:21:48 +0200 (MEST)
Newsgroups gmane.text.xml.schematron
Message-ID <[email protected]>
Bob,

[me]
> >Do you see any (semantic) difference between
> ><schema xmlns:p="urn:my-personal-namespace" ...>
> >and
> ><schema ...>
> >  <ns uri="urn:my-personal-namespace" prefix="p" />
>  
[Bob]
> My original posting that started this thread explained why the first option
> didn't work for me. It looks like the second option won't either, since the
> whole point of my rules file was to take advantage of a particular XSLT 2
> feature, so I can't use ns either. 

These are two different things: I believe that from the Schematron point of 
view (or the Schematron user's POV) there should be no difference between 
these two notations.

The other thing is, as you noted, that the current implementation 
very well makes a difference.

Well, you have to change the implementation (the skeleton...xsl) in
any case. To use XSLT2 features you must create an XSLT 2 stylesheet.
That means you have to change the version attribute in <axsl:stylesheet>
from 1.0 to 2.0.
Now you can use the <ns> element and that should work with any XSLT
processor.

Or (as I suggested), change the skeleton a little bit more by adding
<xsl:copy-of select="namespace::*"/> and you can get rid of that <ns>
element at all.
This is a little bit awkward, since now you have to use an XSLT 1 processor
to create the validating stylesheet from your Schematron schema and 
afterwards an XSLT 2 processor to apply the generated stylesheet.
A full XSLT2-based solution requires the new functions cited in my
<xsl:for-each ... example.

Anyway, there *is* a solution to your problem.
You simply have to choose which one you like more :-)

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