Jeremy Quinn wrote:
> 
> I am trying to get a button to instantiate a template:
> 
>         this one, with or without the ns declaration, never un-dims the 
> button:
> 
>      <item label="Chapter" command="add"
> parameter="after[implicitElement]
>                         {http://www.xmlmind.com/xmleditor/schema/
> iniva}#template(chapter,linked)"/>


Change:

{http://www.xmlmind.com/xmleditor/schema/iniva}#template(chapter,linked)

to:

#template({http://www.xmlmind.com/xmleditor/schema/iniva}chapter,linked)



> Where the elementTemplate looks like this:
> 
>    <elementTemplate parent="section" name="linked" selectable="true"
>         xmlns="http://www.xmlmind.com/xmleditor/schema/iniva";>
>      <chapter link="???" label="???">
>        <meta>
>         <title>your title here</title>
>         <desc>your description here</desc>
>        </meta>
>        <p>your content here</p>
>      </chapter>
>    </elementTemplate>
> 
> this one makes a chapter fine, but is not using the elementTemplate:
> 
> <item label="Chapter" command="add" parameter="after[implicitElement]
> {http://www.xmlmind.com/xmleditor/schema/iniva}chapter"; />
> 
> Can anyone see what I am doing wrong?

The xmlns attribute moves elementTemplate out of the XXE configuration
namespace.

Change:

<elementTemplate parent="section" name="linked" selectable="true"
                 xmlns="http://www.xmlmind.com/xmleditor/schema/iniva";>
  <chapter link="???" label="???">
</elementTemplate>

To:

<cfg:elementTemplate parent="section" name="linked" selectable="true"
                    
xmlns="http://www.xmlmind.com/xmleditor/schema/iniva";>
  <chapter link="???" label="???">
</cfg:elementTemplate>

This assumes that the cfg prefix is declared on root element of the XXE
configuration file as
xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration";

Note that you don't need to specify parent="section" if there are no
different types of element called chapter (i.e. if a chapter can only be
a child of a section).

Reply via email to