W3C home > Mailing lists > Public > public-web-http-desc@w3.org > February 2009

WADL representation/@element in xmlns=""

From: Klotz, Leigh <Leigh.Klotz@xerox.com>
Date: Fri, 27 Feb 2009 12:47:34 -0800
Message-ID: <E254B0A7E0268949ABFE5EA97B7D0CF4071D9629@USA7061MS01.na.xerox.net>
To: <public-web-http-desc@w3.org>
Cc: "Jurgielewicz, Mariusz" <Mariusz.Jurgielewicz@xerox.com>, "Klotz, Leigh" <Leigh.Klotz@xerox.com>
I am reporting a confusion I'm suffering about a WADL
representation/@element which refers to an element not in a namespace,
or in xmlns="" if you prefer to treat it that way.  I've found what I
believe is ambiguity in the spec, and an error in the
wadl_description.xsl stylesheet.

1. The Issue

My colleague Mariusz Jurgielewicz has shown me a WADL file containing 
<application xmlns="http://research.sun.com/wadl/2006/10">
  <representation mediatype="application/xml" element="foo" />

He noted that wadl_description.xsl was unable to find the Schema for the

I changed the WADL as follows:
<w:application xmlns="" xmlns:w="http://research.sun.com/wadl/2006/10">
  <wadl:representation mediatype="application/xml" element="foo" />
since it appears that wadl_description.xsl interprets the namespace of
unqualified attribute values of representation/@element as being in the
default namespace of the context.

However, it still doesn't work.

2. What the spec says

Not seeing much discussion on this list about namespaces or xmlns, I
consulted the WADL paper to see how to express no-namespace @element

The wadl20090202 WADL paper says that representation/element is defined
as follows:
  For XML-based representations, specifies the qualified name of the
  element as described within the grammars section - see section 2.3.

It seems like a good idea to be more precise here.  

Since XML doesn't define namespace rules for processing attribute value
content, so that's up to the application.  CURIEs are one approach, but
since this specification is about XML elements themselves, it's not a
good match.  XML Schema is more specific about it.  
The exact XML Schema approach won't work in WADL, because WADL isn't
about exactly one namespace, but I think it points again in the
direction that more precision about unqualified attribute values is
required, either in prose, or in additional markup for the WADL document

A cautionary tale: XForms wasn't specific about the namespace of its
xf:bind/@type attribute, and some implementers chose it to default to
the XML Schema, while others chose it to be the host document.  Finally
the WG decided to fix the problems, by making the XForms namespace by
default, and to preserve interoperability with those who had chosen XSD
as the default by including copies of the XSD types in that namespace.

3. What wadl_description.xsl does
As for wadl_description.xsl, I believe that if it is to be able to
render WADL representations with elements in xmlns="", the stylesheet
needs some adjustments. 

I found that in wadl_documentation.xsl,
template/@match="wadl:representation|wadl:fault" calls
template/@name="get-element", which its qname argument to be qualified,
and cannot process unqualified element names.

        <xsl:variable name="localname" select="substring-after($qname,

Certainly this could be changed to
        <xsl:variable name="localname">
            <xsl:when test="substring-after($qname,
':')=''"><xsl:value-of select="$qname" /></xsl:when>
            <xsl:otherwise><xsl:value-of select="substring-after($qname,
':')" /></xsl:otherwise>
But I suspect a more comprehensive fix is in order.

Received on Friday, 27 February 2009 20:48:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:58:35 UTC