Oxygen overwrote xsl script during debugging session

Having trouble installing Oxygen? Got a bug to report? Post it all here.
sderrick
Posts: 264
Joined: Sat Jul 10, 2010 4:03 pm

Oxygen overwrote xsl script during debugging session

Post by sderrick »

I'm sure I must have hit some button inadvertently but it was a surprise and potentially very costly mistake.

I was debugging an xsl acript, the debugger view started as usual, 3 main views, on the left was the source xml document, in the middle was the xsl script, on the right was the empty pane that the result document would show up in.

I set a break point in the source doc and hit the run button. It stopped on the break point and then a moment later the xsl document was replaced with the output of the transformation result created up to the break point..

WTF!!!! Not only that but the xsl script was gone! Nada, toast! I could not hit undo and restore it! This is one of my main xsl scripts. Luckily I backup every morning, well most mornings, sometimes the network is glitchy and a backup will fail, but thats pretty rare. Also lucky I hadn't done much work in that file today so only lost 30-45 minutes work which took an hour to recover. 2 hours lost to a unknown glitch.

The big question is how or why did did this happen and how do I prevent it from ever happening again! Why did the result of a debug session get written to the xsl file? It's never happened before and I don't remember changing anything previous to that that could cause that?

And Why didn't I get the "This file changed on disk, do you wish to reload the file" warning. I would have said **** NO!

Scott
sderrick
Posts: 264
Joined: Sat Jul 10, 2010 4:03 pm

Re: Oxygen overwrote xsl script during debugging session

Post by sderrick »

I have a little more information on this data loss problem.

MY script generates a single document or splits the output into multiple documents depending on a parameter.

So I am using result-document for both type of output so I can pass in the named <output...>

my two result-document calls

multiple files, this is in a for-each loop with $filename changing for each chapter.

Code: Select all


<xsl:result-document href="{$filename}" format="csps-xhtml">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </meta>
...
single document, this is where the debugger wipes out the script.xsl file

Code: Select all


<xsl:result-document  format="csps-xhtml">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </meta>
all very similar except there is no href attribute supplied to result document because saxon handles where the output goes.

The result-document call without a href, causes data loss, very bad!

How can I keep the needed versatility of my script and still use the debugger without smashing the script being debugged and see the output of the transformation in the data output view?

Scott
sderrick
Posts: 264
Joined: Sat Jul 10, 2010 4:03 pm

Re: Oxygen overwrote xsl script during debugging session

Post by sderrick »

I have found a solution to my problem, though it doesn't prevent the bug in the editor from overwriting someboys script in the future. :cry:

I was reading the spec for <output..> and realized I can have more than one definition!

One that is named to pass to <result-document>(multiple output) and an identical one that is not named for default processing(single output) that does not use <result-document>!

The only issue is my current copy of saxon 9.1.0.7, complains when I have two <output>'s, a named and an unnamed <output> element(s)?

If I use HE9.3.05, it processes multiple <output> elements, but then I can't use

Code: Select all


      xmlns:saxon="http://saxon.sf.net/"
extension-element-prefixes="saxon"

saxon:character-representation="hex"
to output hex upperlevel unicode...

The HE parser won't accept that URI and says I have to purchase the PE version to use it?

I guess I don't get to have my cake and eat it too?

Scott

so that the
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Oxygen overwrote xsl script during debugging session

Post by george »

Hi,

If there is no output set for a transformation then all relative references on result-document were resolved to the current working directory, which normally is the oXygen installation folder. We modified this by setting the system ID as the XSLT system ID and everything worked well even with the result-document without href. However, in the last version of Saxon included in oXygen there was a change in Saxon behavior that instead of directing that output to the principal result (the default output) passes the resolved href value against the output system ID through a resolver and as you probably see by now in case of an empty href that ends up as the stylesheet system ID.
oXygen asks for confirmation on reloading content from disk, but the default is set to ask only if the file is modified inside the editor.

We fixed this already and version 12.2 (a free upgrade from 12.1) will have this fix included.

Sorry for the trouble this caused you!

Best Regards,
George
George Cristian Bina
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Oxygen overwrote xsl script during debugging session

Post by george »

Your last reply and my reply were almost in the same time...

Maybe it is not clear from my earlier reply but if you set an output file for the transformation output then the result-document without href will go to that file and you will not have this problem anymore.

Version 12.2 is expected to be available really soon - we are fixing the last issues and getting ready for the final release phase.

Best Regards,
George
George Cristian Bina
sderrick
Posts: 264
Joined: Sat Jul 10, 2010 4:03 pm

Re: Oxygen overwrote xsl script during debugging session

Post by sderrick »

George,

thanks for the prompt reply.

Glad to hear you guys are on top of it!

I think my license expires in 16 days! Hurry up! :D

Scott
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Oxygen overwrote xsl script during debugging session

Post by george »

Do not worry... only trial licenses are expiring, all the other licenses are permanent. If you are referring to the maintenance pack then you should know that you need that further only to access following major versions (that is 13.0, etc.), all version 12.x releases work with the same license key that is good for 12.0.

Best Regards,
George
George Cristian Bina
sderrick
Posts: 264
Joined: Sat Jul 10, 2010 4:03 pm

Re: Oxygen overwrote xsl script during debugging session

Post by sderrick »

Ah, sounds good to me!

Oxygen is one of the finest editors I've used in my 25 years of software development. And the technical support is awesome!

thanks,

Scott
Post Reply