[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Why Use anyURI

  • From: Michael Glavassevich <mrglavas@ca.ibm.com>
  • To: xml-dev@lists.xml.org
  • Date: Wed, 15 Sep 2010 08:10:41 -0400

Re:  Why Use anyURI

Michael Kay <mike@saxonica.com> wrote on 09/15/2010 04:04:40 AM:

> The road to xs:anyURI was paved with good intentions. The XSD 1.0
> spec is notoriously vague about what validation rules should be
> applied to it (it contains the notorious phrase "This definition
> imposes only very modest obligations on ·minimally conforming·
> processors", while failing to say clearly what those obligations
> are) and in consequence many implementations allow anything (or
> almost anything).


The spec also says that "anyURI is finite-length character sequences which, when the algorithm defined in Section 5.4 of [XML Linking Language] is applied to them, result in strings which are legal URIs ...". Once you apply those escaping rules from XLink you find that the class of strings which aren't in the lexical space of anyURI is quite small.

FWIW, Xerces does check anyURIs against the grammar for URI in the RFCs (after first applying the XLink escaping to the string).

> In XSD 1.1 the WG admitted defeat and changed the
> spec so the lexical space is exactly the same as xs:string. The
> XQuery and XSLT specifications also treat xs:anyURI more-or-less as
> equivalent to xs:string.
>
> So should you use xs:anyURI? Well, it provides a bit of
> documentation of your intent, and it might give you better bindings
> to data types in other languages. It has a bit more semantics than
> xs:string, though it's all very implicit. But the fact that
> something is present in a spec doesn't mean you have to use it.
>
> Michael Kay


Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com

E-mail: mrglavas@apache.org



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.