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

Re: Namespaces, Xml Schema Whitespace normalization, xs:anyURI


whitespace preserve
> 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 ?

There are tests in the XML Test suite that check specifically for URI 
validation. I see that Mike Kay just responded saying the exact 
opposite... and when I am not sure about something I defer to people 
like Michael Kay. Checking the Namespaces in XML 1.1 rec confirms this:

"To conform to this specification, a processor MUST report violations of 
namespace well-formedness, with the exception that it is not REQUIRED to 
check that namespace names are legal IRIs."

*sigh*


> 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.

> 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.

I see where you are coming from, but a schema can be used for a variety 
of different things in the XML landscape. I think we are agreeing here.

> 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-.

Many people would insert a comment about your use of "reasonable option" 
and "XML Schema" in the same sentence :). I agree it would be reasonable 
to expect that, but like others have pointed out... namespaces/uris and 
there use throughout XML has lots of warts.

>  
> 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

Well, those browsers accept a lot of things that aren't necessarily 
valid. I think that is the intent here as well... when you have 
something that can safely be converted to a URI the XML Schema rec 
allows for it. In terms of the multiple spaces being normalized, you 
could always create a derived type that constrained the whiteSpace facet 
to preserve. From the XML Schema view, if your application is consuming 
the PSVI it would only see the corrected URI anyway.


>  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 ?

Sorry, by legal I meant valid according to the URI rfc.

Cheers,
Jeff Rafter

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.