[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Namespaces, Xml Schema Whitespace normalization, xs:anyURI
> > > > I am not sure if I want this uri > > to be reported as valid when doing > > validation of machine-written data > > ( like for example for the urls of a > > publishing system): > > > > 1) http://www.example.org/c a/c%20b > > Technically this is not a valid URI and therefore > not a legal namespace > name. It is a valid xs:anyURI, though it is > problematic. The reason it > is valid is because spaces are allowed lexically and > validation is > performed against the value space (which is defined > to be the lexical > value with the XLink algorithm applied). Now, the > fact that XLink lumps > disallowed and excluded characters into one group > and the algorithm > performs %hh escaping on the whole set is what > creates this oddity I think. I agree that the uri of the example is a valid xs:anyURI following the specs. And also that this might be problematic. About the namespace name being an URI or an xs:anyURI or simply a string, I am not sure, parsers will be ok with any not empty xml characters sequence as namespace "uri", right ? I was thinking more to the case of xs:anyURI as base type for an URL type like the href attribute of html, to give the idea. > > > When I am not so strict and I support > > the user with some uri escaping > > I would like to help him when he types > > > > 2) http://www.example.org/c a/ > > > > to be resolved 'correctly' to > > > > http://www.example.org/c%20%20a/ > > > > (as for example windows explorer does) > > > > and not to > > > > http://www.example.org/c%20a/ > > > > may be I am missing something.. > > You would do this in your application-- before it > was ever validated as > an xs:anyURI. Isn't the schema supposed to stay between the xml and my application ? I mean as user someone that writes an xml document, for application I mean a program that uses the xml of the user together with a schema-enabled-processor that provides the program a datatyped value, for example a number that can be summed or a space collapsed text etc. For a form or an editor I agree that url-encoding of characters should be made by the (input) application. I think a reasonable option could be that the schema does not touch the uri so that -is responsability of the application to build the uri, maximum that can be given is trimming-. Otherwise I don't know how can help a validator that, if I have an url like this: <http://example.org/I%20have%20space> tells me that these are all valid lexicals representations of that url: "http://example.org/I%20have%20space" "http://example.org/I%20have space" "http://example.org/I%20have space" "http://example.org/I%20have space" I cannot distinguish between a valid uri like the first one and the others (with a space) that are really wrong. If is data coming from an other app, I think there is something wrong with the application that produces uris like the last ones, but I cannot check it with the schema, I have to do it my self when the schema tells me they are valid. At the same time the only benefit that the user has is to have the space character escaped, all the other characters must anyway be escaped by him or his input application, and also consecutive spaces. May be there is some other use or apect I am not aware of. I noticed now that both IE and Mozilla interperet this as valid url: file:/D:/Music/bob/Catch%20A Fire Generally, the whitespace normalized > value is not what you > deal with in an editor... you deal with the lexical > value. > > > Just to be clear: this should be a valid xs:anyURI > > isn't it ? http://www.example.org/c a/c%20b > > and when I 'map' it to an URI becomes > > > > http://www.example.org/c%20a/c%20b > > > > Right ? > > If by "map" you mean apply the algorithm from XLink > section 5.4, yes. > Note that this kind of "mapping" is not done to > namespace URIs in 1.0 or > 1.1, so in theory you would never have a (legal) > namespace that > contained space characters. Legal for what ? Greetings Michele Vivoda ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|