Thanks for the quick response.

On Mon, Dec 08, 2008 at 06:50:39PM +0100, Hussein Shafie wrote:
> > I have one tiny issue though: My XSLT transformation slightly changes
> > the indentation and white space distribution in the resulting
> > document. 
> 
> Normally, such indentation is ignored by XXE. I don't see what kind of
> troubles this could cause.

It's not so much trouble as my desire not to clutter the history of
version controlled documents with unecessary white space changes.

> > That's why I would like to make XXE automatically (re)save
> > the document after reopening it. What would be the best way to achieve
> > this? I tried to add some commands after XXE.open to modify and save
> > the document. But, apparently, these commands are not executed at
> > all. Is that expected behavior? I'm using XXE 4.1.0 Personal Edition.
> 
> Yes. A macro-command runs in the context of the document being edited.
> Let's call it documentA. The macro-command saves documentA to disk,
> applies an XSLT transformation to it and reopen it to XXE. The document
> reopened in XXE is documentA', not the original documentA. And the
> macro-command that was applied on documentA, has no effect on documentA'.
> 
> In a nutshell, you cannot add any subsequent command after a "XXE.open".

I understand.

> ---
> PS: A bit overkill: add a shell child element to you process command --
> http://www.xmlmind.com/xmleditor/_distrib/doc/commands/shell.html -- in
> order to execute xmltool indent --
> http://www.xmlmind.com/xmleditor/_distrib/doc/xmltool/index.html -- to
> re-indent your XML file exactly like XXE.

Overkill indeed. I'll probably resort to asking my users to remember
to modify/save the document manually after running the transformation
command.

Thanks again!


Reply via email to