Re: RDFa reliance on namespace declaration

Mark,

Thanks for the detailed reply. If I'm understanding correctly, I take 
your position to be something like: "using xslt with qnames in content 
is safe unless you are deliberately removing namespace nodes". Am I correct?

The evidence you cite is that "XSLT is used in hundreds of thousands of 
applications every day, to process documents that contain QNames in 
their attributes."

I don't dispute the fact that we all use a lot of XSLT. But I don't 
believe that qname in content safety is anywhere specified in the XSLT 
recommendation and, as I pointed out, it is explicitly stated that 
prefixes may be changed by processors. The reason few errors are 
encountered are primarily through the use of conventions for namespace 
prefixes such as foaf, cc, xsl, xs, etc.

An application is, of course, free to choose any namespace prefix it 
desires. Try, for example applying this stylesheet to the xml that follows:


<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:x="http://www.w3.org/1999/xhtml"
  xmlns:a="http://example.com/bar#"
 >
<xsl:template match="*">
   <xsl:copy>
       <xsl:copy-of select="@*" />
       <xsl:copy-of select="namespace::*" />
       <xsl:apply-templates select="*"/>
   </xsl:copy>
</xsl:template>

<xsl:template match="x:p">
   <x:p a:ex="test">
       <xsl:copy-of select="@*" />
       <xsl:copy-of select="namespace::*" />
       <xsl:copy-of select="*"/>
   </x:p>
</xsl:template>

</xsl:stylesheet>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:a="http://example.com/foo#"
   xml:lang="en" lang="en">
<head>
   <title>Test</title>
</head>
<body >
<p property="a:annotation">
this is an annotation
</p>
</body>
</html>


I find in MSXSL and in XSLTPROC that the qname in the property attribute 
  has changed it's binding. I'd be interested to see your results.


On 17/06/2006 17:31, Mark Birbeck wrote:
> However, since the theme of this discussion is that we need to avoid
> using QNames in attributes--and invent alternatives--then it's
> obviously important to continue with the XSLT-specific discussion
> here.

Or we can switch to SAX pipelines, or XML databases, or any system that 
may parse, manipulate and then serialize an XML document.



Ian
-- 
http://purl.org/NET/iand
Blogging at... http://iandavis.com/blog
Working on... http://directory.talis.com/

Received on Saturday, 17 June 2006 20:17:23 UTC