[Bug 1502] New: [F&O] escape-uri encompasses & s/b split into 2 distinct functions

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1502

           Summary: [F&O]  escape-uri encompasses & s/b split into 2
                    distinct functions
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: Macintosh
               URL: http://www.w3.org/TR/2005/WD-xpath-functions-
                    20050404/#func-escape-uri
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators
        AssignedTo: ashok.malhotra@oracle.com
        ReportedBy: timbl@w3.org
         QAContact: public-qt-comments@w3.org


The TAG today 2005-06-16 resolved as follows.

The design of escape-uri has a flaw in that it hides within one function two quite different ones.  It 
should be split into two functions corresponding to different values of the escape-reserved flag. 
Possible names are as follows:

encode-for-uri()  takes any unicode string and returns a string which can be used as a path segment in 
a URI.  This function is invertable, and NOT idempotennt.  (Definition of the inverse function would 
clearly be a good idea).  Its semantics are those of your function with the second argument set to TRUE.

clean-uri()  takes a unicode string which may contain URI syntax but (like e.g. IRI) contains invalid URI 
characters. Without disturbing the URI pucntuation, it encodes non-URI characters so that the result is a 
valid [part of a] URI in ascii.  Its semantics are those of your function with the second argument set to 
FALSE.  It is idempotent and NOT invertable.

Received on Thursday, 16 June 2005 18:09:52 UTC