'Given::
<paragraph>
<reference refname="direct internal">
direct internal
<target id="id1" name="direct internal">
The "refname" attribute is replaced by "refid" linking to the target\'s
"id"::
<paragraph>
<reference refid="id1">
direct internal
<target id="id1" name="direct internal">'

def resolve_reference_ids(self, target):

    for name in target['names']:
        refid = self.document.nameids[name]
        reflist = self.document.refnames.get(name, [])
        if reflist:
            target.note_referenced_by(name=name)
        for ref in reflist:
            if ref.resolved:
                continue
            del ref['refname']
            ref['refid'] = refid
            ref.resolved = 1
