Jeremy Quinn wrote: > > >> 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" > > > > OK, I'll give this a try. > I am not sure what difference it makes though .....
It makes a big difference. What you have written was not an elementTemplate element (i.e. an element with localname="elementTemplate" and with namespace="http://www.xmlmind.com/xmleditor/schema/configuration"), it was an element with localname="elementTemplate" and with namespace="http://www.xmlmind.com/xmleditor/schema/iniva". For performance reasons, XXE does not fully check the validity of its configuration files at startup time. I suggest that after starting XXE, you load <your_config>.xxe into it to see if this file is valid. With the elementTemplate you wrote, it was not valid. > Does it mean for instance that I don't have to continue prefixing > commands like this: > {http://www.xmlmind.com/xmleditor/schema/iniva}chapter? No. What I suggest is purely local to cfg:elementTemplate elements. The ugly notation is only used in the parameter string of a command because the parameter string of a command having a command specific semantic (unknown at XXE configuration file parse time), it is difficult to use the prefix mechanism.

