Hi,

Sorry, for the strange mail title...

I have the following requirement to solve in XXE:

Given is an text paragraph with multiple inline elements like:

  <absatz>Im vorliegenden Fall hat der Arbeitgeber am letzten Tag der 
einmonatigen Probezeit gegen?ber der <starke-betonung>Lebensgef?hrtin des 
Arbeitnehmers</starke-betonung> die Beendigung des Dienstverh?ltnisses 
erkl?rt.</absatz>

The author selects the text "des" within the <starke-betonung> element.
With pressing ALT + D the author now wants to "exclude" the selected text from 
the <starke-betonung>

As a result the XML should look like:

  <absatz>Im vorliegenden Fall hat der Arbeitgeber am letzten Tag der 
einmonatigen Probezeit gegen?ber der <starke-betonung>Lebensgef?hrtin 
</starke-betonung>des<starke-betonung> Arbeitnehmers</starke-betonung> die 
Beendigung des Dienstverh?ltnisses erkl?rt. </absatz>

Is there a simple way to accomplish that? Or do I need to run a stylesheet for 
that?

Thanks,
Roman

-----Urspr?ngliche Nachricht-----
Von: Hussein Shafie [mailto:hussein at xmlmind.com] 
Gesendet: Mittwoch, 19. M?rz 2008 10:21
An: Huditsch, Roman (LNG-VIE)
Cc: xmleditor-support at xmlmind.com
Betreff: Re: [XXE] copyChar in conjunction with replace

Huditsch, Roman (LNG-VIE) wrote:
> 
> I now came up with another problem, I couldn't solve.
> I need to copy the current text selection (going over different
> elements)
> to the clipboard (just the text).
> No problem so far. I could do this with
> <cfg:command name="copyChars" parameter="%_"/>
> But how do I manage to replace all "." in this selection with ". "?
> I tried different ways with get and set, but with no success.
> 
> Do you have any hint on how to solve this?

<binding>
   <keyPressed code="F3" />
   <command name="Test" />
</binding>

<command name="Test">
   <macro>
     <sequence>
       <test expression="string-length($selectedChars) &gt; 0 and
                         contains($selectedChars, '.')" />
       <get expression="replace($selectedChars, '\.', '. ')" />
       <command name="paste" parameter="to %_" />
     </sequence>
   </macro>
</command>

* $selectedChars documented in
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/selection_vars.html

* replace() documented in
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/xpathextfunc.html

(string-length() and contains() are standard XPath 1 functions.)

* paste documented in
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/paste.html

Reply via email to