thye wrote:
> from a file (created with xsl) with
> "NAME"
> "<?xml version='1.0'><para>NAME<xref='xycv'/></para>"
> "NextName"
> etc.
> ..
>
> I would like to select one item with pick and insert
> the Name and the xref in the DocBook:
>
> <cfg:command name="pic.adr">
> <cfg:macro>
> <cfg:sequence>
> <cfg:command name="readtrans"/>
> <cfg:command name="pick" parameter="Select true %_"/>
> <cfg:command name="makeparaxref" parameter="%_"/>
> </cfg:sequence>
> </cfg:macro>
> </cfg:command>
>
> <cfg:command name="makeparaxref">
> <cfg:macro>
> <cfg:sequence>
> <cfg:command name="paste" parameter="after[implicitElement] %0"/>
> </cfg:sequence>
> </cfg:macro>
> </cfg:command>
>
> <cfg:command name="readtrans">
> <cfg:process>
> <cfg:read
> file="/tmp/transfile.xml"
> />
> </cfg:process>
> </cfg:command>
>
> I have tried a lot of variation with " and ' and combination
> to escape ". But nothing works.
Sorry for being so late to answer: I was in vacations for the last 2 weeks.
I think the data file generated using XSLT is incorrect:
---
<?xml version='1.0'><para>NAME<xref='xycv'/></para>
---
is non-well-formed XML. It should be:
---
<?xml version='1.0'?><para>NAME<xref linkend='xycv'/></para>
---
^ ^
| |
I've added a '?' and ' linkend'.
Once this is fixed, your macro command works fine. Congratulations for
writing it. You have really understood how all this works.
Here's how I tested all this:
* I have added this to my defaultbindings.xxe.
---
<cfg:command name="loadData">
<cfg:process>
<cfg:read file="/home/hussein/tmp/list.dat" />
</cfg:process>
</cfg:command>
<cfg:command name="insertData">
<cfg:macro>
<cfg:sequence>
<cfg:command name="loadData"/>
<cfg:command name="pick" parameter="Select true %_"/>
<cfg:command name="paste" parameter="after[implicitElement] %_"/>
</cfg:sequence>
</cfg:macro>
</cfg:command>
<binding>
<keyPressed code="F1" />
<command name="insertData" />
</binding>
---
* my list.dat file is:
---
"foo"
"<?xml version='1.0'?><para>foo<xref linkend='foo'/></para>"
"bar"
"<?xml version='1.0'?><para>bar<xref linkend='bar'/></para>"
"gee"
"<?xml version='1.0'?><para>gee<xref linkend='gee'/></para>"
---
* during testing, I have inserted:
---
<cfg:command name="alert" parameter="%_" />
---
in various places to debug the macro.