W3C home > Mailing lists > Public > xml-dist-app@w3.org > March 2003

Are empty strings legal xs:anyURI

From: Martin Gudgin <mgudgin@microsoft.com>
Date: Wed, 26 Mar 2003 17:51:37 -0800
Message-ID: <7C083876C492EB4BAAF6B3AE0732970E0AD6DEDF@red-msg-08.redmond.corp.microsoft.com>
To: <xml-dist-app@w3.org>

I took an action on the call today to figure out whether empty strings
are legal in attributes of type xs:anyURI. Here is my analysis:

The xs:anyURI[1] type is based on RFC2396[2] as amended by RFC2732[3].
Here is the breakdown:

  URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]

If this really does mean [] instead of () then an empty string is
allowed. If not, then:

  absoluteURI   = scheme ":" ( hier_part | opaque_part )
  relativeURI   = ( net_path | abs_path | rel_path ) [ "?" query ]

So, all absoluteURI begins with a scheme and a colon. So they can't be
the empty string.
relativeURI can be one of three things:

  net_path      = "//" authority [ abs_path ]
  abs_path      = "/"  path_segments
  rel_path      = rel_segment [ abs_path ]

So, net_path and abs_path can't be empty. That just leaves rel_path:

  rel_segment   = 1*( unreserved | escaped | ";" | "@" | "&" | "=" | "+"
| "$" | "," )

which says there must be 1 or more of the characters listed in the
parens.

So, it all depends on the first production. I'm assuming at this point
that empty strings are allowed.

I would also note that schema validation does NOT take into account XML
Base[4], so although our spec DOES take into account XML Base it doesn't
affect the set of legal values for the soap:role attribute ( or any
other attribute of type xs:anyURI ).

Gudge

[1] http://www.w3.org/TR/xmlschema-2/#anyURI
[2] http://www.ietf.org/rfc/rfc2396.txt
[3] http://www.ietf.org/rfc/rfc2732.txt
[4] http://www.w3.org/TR/xmlbase
Received on Wednesday, 26 March 2003 20:51:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:13 GMT