Skopik Pavel wrote:
> 
> I have created a set of macro commands for setting conditions on DocBook 
> 4.5 documents. We are migrating to DocBook 5, so I just wanted to adapt 
> these commands slighty to work with the DB5 configuration.
> 
> It works fine expcet the one which is used to remove conditions.
> 
> The command works in this way:
> 
> -if the caret is on the phrase element with the condition attribute set, 
> the phrase is converted to text ? this is for inline content
> 
> -if a block element is selected only the condition attribute is removed.
> 
>  
> 
> This is the macro command itself:
> 
> <command name="delCondition"         
> 
>   xmlns="http://www.xmlmind.com/xmleditor/schema/configuration";
> 
>          xmlns:db="http://docbook.org/ns/docbook";
> 
>         xmlns:sf="http://www.aipsafe.cz/ns/docbook-extension";
> 
>         xmlns:xlink="http://www.w3.org/1999/xlink";>
> 
>   <macro undoable="true"
> 
>          repeatable="false"
> 
>          trace="false">
> 
>       <choice>
> 
>         <sequence>
> 
>           <match context="$implicitElement" pattern="phra...@condition]"/>
> 
>  
> 
>           <command name="selectNode"
> 
>                        parameter="ancestorOrSelf[implicitElement]"/>
> 
>  
> 
>           <command name="convert" parameter="#text"/>
> 
>         </sequence>
> 
>  
> 
>         <sequence>
> 
>           <fail>
> 
>             <match context="$implicitElement" pattern="phra...@condition]"/>
> 
>           </fail>
> 
>  
> 
>           <command name="removeAttribute"
> 
>                        parameter="[implicitElement] condition"/>
> 
>         </sequence>
> 
>       </choice>
> 
>     </macro>
> 
>   </command>
> 
> The problem is that only the second sequence works the way it should. 
> When I want to convert the phrase element to text, only the condition 
> attribute is removed. At this point I am not sure what is wrong, because 
> this command works fine when editing DocBook 4.5 documents. I also tried 
> the pass construct in the first sequence but without success.
> 

---
<match context="$implicitElement" pattern="phra...@condition]"/>
---
always fails with DocBook 5 (which has no "phrase" element).

Please specify:
---
<match context="$implicitElement" pattern="db:phra...@condition]"/>
---





Reply via email to