Kim Schulz wrote:
> Is there a way to insert xsl formatting commands via an elementTemplate
> ?
> I have tried something like:
> <elementTemplate name="pagebreak" selectable="override">
> <![CDATA[ <? pagebreak ?> ]]>
> </elementTemplate>
> Except that it does not work.
* An elementTemplate is a template for an *element* and
"<![CDATA[ <? pagebreak ?> ]]>" is clearly not an element (This is not
even a processing instruction. This is just text).
* This being said, the element contained inside an elementTemplate
configuration element can contain anything, including a "<?pagebreak?>"
processing instruction.
> I try to insert this with via a toolbar button like:
> <button toolTip="Add pagebreak" icon="../common/icons2/para.gif">
> <command name="docb.addAfter" parameter="#template(PI,pagebreak)"
> />
> </button>
The right way to do that is simply:
---
<button toolTip="Add pagebreak" icon="pagebreak.gif">
<command name="insertNode"
parameter="piAfter[implicitElement] pagebreak"/>
</button>
---
See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/insertNode.html
---
PS: It is quite easy to properly render <?pagebreak?> on screen using
CSS. See
http://www.xmlmind.com/xmleditor/_distrib/doc/csssupport/pi_comments.html