I found the answer to the question of duplicate headings:
 
The Nth duplication is suffixed with -N.
 
An existing link would therefore be broken if a header with identical text were added above it, thus changing its name.
 
I think that's a bug; at least, I don't like it, and I can't think of a way to code around it.
 
I thought of naming them according to their place in the header hierarchy, but that would be a move backward from position-independent naming.
 
Since I'm going backwards anyway, I'll back up to considering what the requirement is for a truly robust link name.  Primarily, this would be that it won't change relative to the link, regardless of what happens to the page's source content, including changing the heading text...  Okay, that's ridiculous; I give up.
 
Never mind...

brain[sic]

 


From: wikibc@googlemail.com [mailto:wikibc@googlemail.com] On Behalf Of Guillaume Lerouge
Sent: Wednesday, May 16, 2007 11:34 AM
To: xwiki-users@objectweb.org
Subject: Re: [xwiki-users] Intra-document links to XWiki headers in 1.0B3

Hi,

I'd say that right now you can more or less reliably name your internal link like this:

Say you have:

1.1.1 I am a cool subtitle

You can link to it using [Whatever>#HIamacoolsubtitle] (note that there is no space).

As a general rule the anchor name is #HSubtitlewithoutspaces (though I've no idea what happens if 2 anchors have the same name).

This will take you to Spacename/PageName#HIamacoolsubtitle , which hopefully is where you want to be.

I think your issue goes further than this, but this is a start...

Guillaume