2

Is a link like this valid?

http://some.server/some/path#123

According to "List of valid characters for the fragment identifier in an URL?" answers, it should be valid. However, APT parser complains that this kind of link is not valid.

These links are generated by JXR and I wonder if JXR should be fixed or is APT parser broken (APT is used by Maven site plugin).

Community
  • 1
  • 1
Neeme Praks
  • 8,956
  • 5
  • 47
  • 47
  • Remember that an `id` attribute in HTML [must](http://www.w3.org/TR/html4/types.html#type-name) begin with a letter. – Josh Lee Aug 18 '11 at 16:15

2 Answers2

3

That link is invalid for html/xml documents. Fragment identifiers refer to id or name attributes of tags.

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 (".").

http://www.w3.org/TR/html4/types.html#type-name

kapex
  • 28,903
  • 6
  • 107
  • 121
  • 2
    according to your description, the link itself is valid; however, on an HTML/XML page it cannot refer to a document fragment because fragment IDs must begin with a letter. If that URL would refer to some other type of content (that allows such fragment IDs), it would be perfectly OK. – Neeme Praks Aug 18 '11 at 16:31
  • You are right, according to [rfc3986](http://tools.ietf.org/html/rfc3986) the fragment's format depends on the media type used. I edited the answer to male it more specific. – kapex Aug 18 '11 at 18:50
0

For what it's worth. I have noticed this years ago and filed a bug: http://jira.codehaus.org/browse/JXR-87 Ridiculously, this is a one line to fix.

Michael-O
  • 18,123
  • 6
  • 55
  • 121