[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gjdoc URI Dilemma
From: |
Chris Burdess |
Subject: |
Re: Gjdoc URI Dilemma |
Date: |
Wed, 25 May 2005 15:14:30 +0100 |
User-agent: |
Mutt/1.3.28i |
Julian Scheid wrote:
> Sascha Brawer wrote:
> >Url-escaping wouldn't work?
> >
> >http://developer.classpath.org/doc/java/io/InputStream.html#read%28byte%5b%5d,int,int%29
> >
> >
>
> No, unfortunately that's not enough. Here are the relevant parts of the
> spec again:
>
> http://www.w3.org/TR/xhtml1/#C_8
> http://www.w3.org/TR/REC-xml/#id
> http://www.w3.org/TR/html4/types.html#h-6.2
>
> To quote from the XML 1.0 spec:
>
> [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar
> | Extender
> [5] Name ::= (Letter | '_' | ':') (NameChar)*
>
> And from the HTML 4 spec:
>
> ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
> followed by any number of letters, digits ([0-9]), hyphens ("-"),
> underscores ("_"), colons (":"), and periods (".").
In that case I think the anchor name should (1) be URL-encoded as Sascha
suggests above, and then (2) instances of '%' in the resulting name
should be replaced by '-'. Since '-' is not a valid Java name character,
there can be no ambiguity (which would be the case with '_', for
instance).
I recommend that ':' not be used as a replacement character; although quite
valid in XML 1.0 Names, the colon is used extensively to denote a namespace
prefix.
--
Chris Burdess