Re: RDFa reliance on namespace declaration

Ian,

On 16/06/06, Ian Davis <iand@internetalchemy.org> wrote:
> On 16/06/2006 22:11, Mark Birbeck wrote:
>   > Perhaps you could tell me what software you are using, which versions,
> > and so on, and I can download them and try all of this outside of
> > oXygen. And if you have time, perhaps you can look at other XSLT
> > processors to see if you ever get the 'unused' namespaces through.
>
> I'm using command line xsltproc on win32
>
> D:\tmp>xsltproc --version
> Using libxml 20611, libxslt 10103 and libexslt 803
> xsltproc was compiled against libxml 20606, libxslt 10103 and libexslt 803
> libxslt 10103 was compiled against libxml 20606
> libexslt 803 was compiled against libxml 20606

Thanks. I'll see what I can do about reproducing the fact that the
namespaces are being lost.


> xsl:copy-of will copy the namespace nodes, but in Ben's home page
> they're declared on the html element which isn't being copied using
> xsl:copy-of, a pretty typical occurrence if I want to annotate the html
> in some way. I should be able to write my xslt without needing to have
> specific knowledge of where target instance documents choose to declare
> the namespaces.

Firstly, this is not how XSLT behaves, Ian. XSLT doesn't actually know
anything about namespace *declarations*--what it deals with are
namespace nodes. If you declare CC on the <html> element, then you
will have a namespace node for CC on *every* element in the document.
At any point in the tree you can copy all of the current in-scope
namespaces. That's what you did when you used xsl:copy-of, and that's
why you *should* get CC and FOAF namespaces copied through onto <head>
and <body>. That's what I get in all of the XSLT processors I have
tried.

Secondly, it really is standard practice to just copy all namespaces
in scope on the root element (if you want them there), by using
namespace::*. You can still modify the <html> element if you want to,
to add other stuff.

Regards,

Mark

-- 
Mark Birbeck
CEO
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/
b: http://internet-apps.blogspot.com/

Download our XForms processor from
http://www.formsPlayer.com/

Received on Friday, 16 June 2006 23:06:13 UTC