John L. Clark wrote:
> 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.
> 

Why not? This is an idea. But first of all, I think we should try harder
when attempting to convert something to an element such as DocBook 5 <link>.

I mean, inserting a <link> works fine out of the box. This command
automatically adds the linkend attribute (though this attribute is not
formally required; one of linkend and xlink:href, but not both, is
required). Why doesn't command convert do the same? We have to seriously
check this.


Reply via email to