Fabián M. wrote:

I'm trying to add a button to the toolBar that would insert the
following PIs:

<?dbfo orientation="90" ?>
<?dbfo rotation-width="30mm" ?>

I've put on my 0docbook5.xxe something like this (I hope the cut&paste
worked fine...):

<commandname="insertRotateTablePIs">

     <macro undoable="true">

       <sequence>

         <commandname="insertNode"parameter="piBefore dbfo
orientation='90'"/>

         <commandname="insertNode"parameter="piAfter dbfo
rotation-width='30mm'"/>

       </sequence>

     </macro>

   </command>


and what I'm getting on the XML when click on the button running that
command is:

<?target ?>

I've tried also to putAttribute after the 1st insertNode, but it's not
working either... so, before I go and write a custom java command to
insert the above 2 PIs, is there any way this can be done with
'existing' XXE commands?

If you carefully read the documentation of command "insertNode", you'll notice that this command does not allow to insert the *contents* of a processing-instruction (e.g. orientation='90'), but just an empty processing-instruction having specified target (e.g <?dbfo?>). See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/insertNode.html

(Command "insertNode" has been designed to be mainly used interactively.)

Instead, you need to use ubiquitous command "paste". See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/paste.html

The following macro can be used in a DocBook 5 document after you click anywhere inside a CALS table entry or after if you explicitly select a CALS table row:

---
<command name="rotateCells">
  <macro>
    <sequence>
      <command name="selectNode"
               parameter="ancestorOrSelf[implicitElement]
                          {http://docbook.org/ns/docbook}entry
                          {http://docbook.org/ns/docbook}row"; />
      <command name="selectNode" parameter="firstChild" />
      <command name="paste"
               parameter="before &lt;?xml version='1.0'?>
&lt;ns:clipboard xmlns:ns='http://www.xmlmind.com/xmleditor/namespace/clipboard'>&lt;?dbfo orientation='90'?>&lt;?dbfo rotation-width='30mm'?>&lt;/ns:clipboard>" />
    </sequence>
  </macro>
</command>

<binding>
  <keyPressed code="F4" />
  <command name="rotateCells" />
</binding>
---




--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to