public-rdf-in-xhtml-tf  

Re: RDFa reliance on namespace declaration

Mark Birbeck
Fri, 16 Jun 2006 07:25:13 -0700


Hi Ian,

Thanks for replying.

This stylesheet strips namespaces from ben's homepage when I run it
under xsltproc.

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:x="http://www.w3.org/1999/xhtml";
 >

<xsl:template match="x:html">
   <x:html>
     <xsl:copy-of select="*"/>
   </x:html>
</xsl:template>

</xsl:stylesheet>

It's obviously because I don't copy the html element, but I think this
stylsheet isn't atypical.


What do you mean by "strips namespaces"? Are there *no* namespace
declarations in the resulting document? That's very odd if that is the
case, since xsl:copy-of should pass any namespaces through--so
although you won't have all of your pre-existing namespaces still
intact on the root element, you'll still get them on other elements.

And given that this is the effect--i.e., the stylesheet you have
created is actually *designed* to remove namespaces (except for 'x')
from the root element!--in what sense do you see it as "atypical". Do
you have a particular use case in mind?

So, two questions:

* are you really losing all namespace declarations from the document,
or do you just mean that they have been removed from the root
element?;
* why do you see it as a common need to write a stylesheet that very
consciously removes all namespace declarations from the root element?

All the best,

Mark


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

e: [EMAIL PROTECTED]
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/