[jdom-interest] Syntax of namespace URIs
Jason Hunter
jhunter at xquery.com
Mon Jan 10 17:11:22 PST 2005
Rusty, I believe that was your original code? The basic logic's been
there since at least May 2000. I agree that checking the URI according
to the rules in RFC 2396, Appendix A, is above and beyond the call of
duty. Seems like the best options are to (a) not do any checking or (b)
check for common easy to identify mistakes (whatever those might be).
-jh-
Michael Kay wrote:
> I was looking at the JDOM code for validating a namespace URI
> (Verifier#checkNamespaceURI).
>
> It seems to accept any string so long as it doesn't start with a digit, a
> dollar, or a hyphen.
>
> Where does this rule come from? It doesn't seem to bear any resemblance to
> anything in RFC2396.
>
> If we adopt the notion that relative namespace URIs are disallowed, then the
> URI has to start with a scheme name which has to start with an ASCII letter.
>
> If on the other hand relative namespace URIs are allowed (they are legal
> according to the namespaces REC, but not according to the InfoSet), then
> names starting with a digit are fine.
>
> I would have thought one should either allow any string (as most XML parsers
> do, I believe), or one should apply the rules strictly. This code seems to
> be a strange half-way-house.
>
> Michael Kay
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
More information about the jdom-interest
mailing list