It looks like that is my problem (the main macro code runs an XSL
transformation on the whole document, and replaces the old contents with the
transformation results). Is it possible to put the cursor back where it was
in such a situation, and if so , how? The overall structure of the document
is unchanged (all the transformation does is add/refresh some attribute
values).

-----Original Message-----
From: [email protected]
[mailto:xmleditor-support-bounces at xmlmind.com]On Behalf Of Hussein
Shafie
Sent: 4. juni 2004 11:12
To: Kevin Flynn
Cc: xmleditor-support at xmlmind.com
Subject: Re: [XXE] repositioning the cursor in a macro


Kevin Flynn wrote:
> I would like to reposition the cursor after running a macro, and would
> expect the following code to do it, but I'm clearly misunderstanding
> something.
>
>      <cfg:sequence>
>
>         <cfg:set expression="$dot" variable="saveDot"/>
>         <cfg:set expression="$dotOffset" variable="saveDotOffset"/>
>         <cfg:set expression="$mark" variable="saveMark"/>
>         <cfg:set expression="$markOffset" variable="saveMarkOffset"/>
>
>         ...main macro code...
>
>         <cfg:set expression="$saveDot" variable="dot"/>
>         <cfg:set expression="$saveDotOffset" variable="dotOffset"/>
>         <cfg:set expression="$saveMark" variable="mark"/>
>         <cfg:set expression="$saveMarkOffset" variable="markOffset"/>
>
>       </cfg:sequence>
>
> What am I doing wrong?

Nothing, except that if the nodes contained in $saveDot and in $saveMark
have been detached from the document (due to what is done by "main macro
code"), it is no longer possible to use them to restore the selection.

I highly recommend that you add trace="true" to your macro and that you
run XXE with a console (On Windows, how to do this is explained here:
http://www.xmlmind.com/xmleditor/_distrib/docs/dev/ar01s01.html#d0e88).

If you do this, you should have detailed error messages.




--
XMLmind XML Editor Support List
xmleditor-support at xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support


Reply via email to