Do not generate name tags from section names
--------------------------------------------

         Key: MPXDOC-158
         URL: http://jira.codehaus.org/browse/MPXDOC-158
     Project: maven-xdoc-plugin
        Type: Improvement
    Versions: 1.9.1    
 Environment: ?
 Reporter: Lukas Theussl
 Assigned to: Arnaud Heritier 
 Attachments: site.jsl.patch

In the current version of the xdoc plugin, a <a name="sectionName"> element is 
generated for every sub/section from its corresponding
name tag. This may lead to an invalid HTML document if some sub/sections have 
the same name, because according to the HTML 4.01 specs ( 
http://www.w3.org/TR/html4/struct/links.html#h-12.2.1 ), anchor names must be 
unique within one document. For the xdoc plugin this is not a big problem
because browsers usually ignore identical ids, but we are having troubles for 
the pdf plugin (see MPPDF-40) where identical ids lead to a
build failure.

I suggest to generate an id from an optional id tag as in the following example:

    <section name="Section 1">
      <subsection name="SubSection" id="SubSection1">
      </subsection>
    </section>
    <section name="Section2">
      <subsection name="SubSection" id="SubSection2">
      </subsection>
    </section>

so the section title is constructed from the name tag while the id tag (which 
has to be unique) may be used to reference the section.
I attach a patch to achieve this, if this gets accepted I can easily adjust the 
pdf plugin accordingly.

The only worry is backwards compatibility: xdocs that use the old feature of 
referencing sections by names, will produce invalid links. 
However, I haven't seen this feature documented anywhere, I don't think it is 
widely used and therefore, it should not be a big problem.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to