On Tue, Feb 24, 2009 at 7:59 AM, Hussein Shafie <hussein at xmlmind.com> wrote:
> 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.

Ah, I see the problem.  What about introducing a placeholder element
that could be used to represent the copied content when converting?
This might look like:

  <elementTemplate name="href">
    <link xmlns="http://docbook.org/ns/docbook"; xlink:href="???"
          xmlns:xlink="http://www.w3.org/1999/xlink";>
      <convertedContent/>
    </link>
  </elementTemplate>

Any element template with a 'convertedContent' descendant would then
be available for the "Convert" and "Convert [wrap]" commands, and the
"convertedContent" element would be replaced with the entire node-set
that would have been copied by either command.

Take care,

    John L. Clark

Reply via email to