John L. Clark wrote:
> On Fri, Feb 20, 2009 at 5:42 AM, Hussein Shafie <hussein at xmlmind.com>
> wrote:
>> No, you cannot convert the selection to a link having attribute linkend
>> using Ctrl-T or Ctrl+Shift-T.
>>
>> This is a limitation of XMLmind XML Editor which cannot suggest by
>> itself "convert to link with attribute linkend" OR "convert to linkend
>> with attribute xlink:href" (the linkend and xlink:href attributes are
>> mutually exclusive but one of these two attributes is required).
>
> Interesting. I have also run into this problem. I guessed that this
> might be the reason. Would it be possible to extend the
> 'elementTemplate' configuration element to work for the "Convert" and
> "Convert [wrap]" commands, so that we could do something like this in
> a customization:
>
> <elementTemplate name="href">
> <db:link xlink:href=""/>
> </elementTemplate>
>
> <elementTemplate name="linkend">
> <db:link linkend=""/>
> </elementTemplate>
>
> And then have those two options explicitly available as possibilities
> when trying to convert? That way the end result would be valid by
> explicitly choosing one of the two mutually exclusive options.
>
> Thanks for your consideration,
By default link has a linkend attribute and we already define the
template having a xlink:href attribute.
Excerpt of XXE_install_dir/addon/config/docbook5/docbook5_support.incl:
---
<elementTemplate name="href">
<link xmlns="http://docbook.org/ns/docbook" xlink:href="???"
xmlns:xlink="http://www.w3.org/1999/xlink"></link>
</elementTemplate>
---
This template is suggested by commands insert and replace, but not by
command convert.
Currently element templates are not used by command convert because we
don't see how an element template could be used in the context of this
command:
* convert copies the contents of the element to be converted to create
another element.
* an element template specifies fixed contents.