Bernd Kuemmerlen wrote:
> by default, when inserting a docbook <glossentry>, XXE creates the 
> following XML code:
> 
>   <glossentry>
>     <glossterm></glossterm>
>     <glosssee></glosssee>
>   </glossentry>
> 
> I guess this is automatically derived from the DTD, since the content 
> model of <glossentry> looks like this:
> 
>   glossentry ::=
>   (glossterm,acronym?,abbrev?,
>    (indexterm)*,
>    revhistory?,
>    (glosssee|glossdef+))

True.



> The problem now is that I don't see a way of converting these 
> glossentries to:
> 
>   <glossentry>
>     <glossterm></glossterm>
>     <glossdef></glossdef>
>   </glossentry>
> 
> which is what you want as a default most of the time.

Select element glosssee and *replace* it by element glossdef. For this 
you need to use (rarely used) command Replace.



> I managed to *create* glossentries like this by creating the following 
> template in my customization:
> 
>   <elementTemplate name="mydocbook" selectable="override">
>     <glossentry xmlns="">
>       <glossterm></glossterm>
>       <glossdef><para></para></glossdef>
>     </glossentry>
>   </elementTemplate>

This was the right thing to do.

You are not limited to a single elementTemplate, so why not also add:

    <elementTemplate name="see">
      <glossentry xmlns="">
        <glossterm></glossterm>
        <glosssee></glosssee>
      </glossentry>
    </elementTemplate>

Notice the meaningful name and the absence of selectable="override".


> But now I have the inverse problem: I can't create a glossentry with a 
> <glosssee> element inside.
> 
> So my question is:
> Is there a reason why I can't convert a <glosssee> to a <glossdef> and 
> vice-versa? (because that would be the only way to go from one to the 
> other without breaking dtd conformance).

You cannot convert (i.e. using command Convert) the contents of a 
glosssee to a glossdef and vice-versa because these elements have very 
different content models.

In practice, a glossdef is *semantically* a very different beast from a 
glosssee so this should not be very annoying.

Therefore here too, unless you have defined the right elementTemplates, 
you need to use command Replace.


Reply via email to