Re: Parsing of qualified 'about' attribute

Chris Waterson wrote:
> Edd Dumbill raises an interesting question in:
> 
> news://news.mozilla.org/8eeee1%24pgg2%40secnews.netscape.com
> 
> Specifically related to:
> 
> http://lists.w3.org/Archives/Public/www-rdf-comments/2000AprJun/0019.html
> 
> The Schema and Syntax specification has some inconsistencies between the
> "Formal Grammar". Specifically, rules [6.6] through [6.9], [6.11], and
> [6.18] are not consistent with the examples used throughout the document
> to illustrate RDF/XML. The differences seems to stem from a
> misunderstanding of how XML namespaces apply to attributes.

I just ran across this bug when implementing my XSLT-based parser.
http://www.w3.org/XML/2000/04rdf-parse/
http://lists.w3.org/Archives/Public/www-rdf-interest/2000May/0009.html

I reported it as a bug in the spec:

rdf:resource="..." vs. resource="..." Dan Connolly (Wed, Apr 26 2000) 
http://lists.w3.org/Archives/Public/www-rdf-comments/2000AprJun/0019.html

> What approaches have people taken with their RDF/XML parsers?

I took the approach that:
	rdf:resource="..." works everywhere, and
	resource="..." is taken to mean rdf:resource="..." when the
		namespace name of the element is the RDF M&S namespace.

the source code looks like:

        <xsl:when test='@rdf:ID'>
          <xsl:call-template name='rdfp:propertyElt_s'>
		...
            <xsl:with-param name='subject' select='concat("#",
@rdf:ID)'/>
	  </xsl:call-template>
	</xsl:when>

	...

        <xsl:when test='(namespace-uri() = $rdfNS) and @ID'>
          <xsl:call-template name='rdfp:propertyElt_s'>
		...
            <xsl:with-param name='subject' select='concat("#", @ID)'/>
	  </xsl:call-template>
	</xsl:when>

In my bug report, I suggested that the BNF is just wrong, and the
intent of the spec was clear from the examples:

"I suggest you define the general case to be the rdf:resource case,
and specify that for rdf:Description, an unprefixed attribute
called resource should be treated as rdf:resource."

> Although
> Mozilla is currently "strict" in this regard, I'm leaning towards the
> addage of being liberal with the input that we accept, and treating
> (e.g.)
> 
>   <foo:bar rdf:resource="baz" />
> 
> as really meaning:
> 
>   <foo:bar resource="baz" />.
> 
> Comments?

I suggest you do it the other way around, so that
	<rdf:Description resource="bar"/>
is taken as a short-cut for
	<rdf:Description rdf:resource="bar"/>

I don't see any reason to "steal" the local attribute
names "resource", "ID", "about", etc. from all RDF property elements.

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/

Received on Tuesday, 2 May 2000 01:17:18 UTC