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 _______________________________________________ Cp-tools-discuss mailing list [email protected] http://lists.gnu.org/mailman/listinfo/cp-tools-discuss
