XSpec error

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Oleksii
Posts: 84
Joined: Wed Jul 19, 2017 6:04 pm
Location: Austria
Contact:

XSpec error

Post by Oleksii »

Hi,
I get this error when trying to run a *.spec file, even those provided in the webinar materials: https://www.oxygenxml.com/events/2018/w ... atron.html
Transformation failed. C:\Users\sapov\AppData\Roaming\com.oxygenxml\extensions\v20.1\frameworks\https___www.oxygenxml.com_InstData_Addons_community_updateSite.xml\xspec.support-2.0.0\build.xml:434: Java returned: 2

Code: Select all

[16:48:56] - ANT Transformation 'Run XSpec Test' started
[16:49:05] - ANT Transformation 'Run XSpec Test' failed
What could it be?

oXygen Editor 20.1, build 2020010914
Win10
Kind regards,
Oleksii Sapov-Erlinger
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: XSpec error

Post by Radu »

Hi,

I tried this on my side using Oxygen 23.1:

1) Install the XSpec Framework and Helper View from the Oxygen Help->Install new add-ons menu.
2) Re-start Oxygen, open a sample XSpec file which comes with Oxygen from OXYGEN_INSTALL_DIR/samples/xspec/xslt/escape-for-regex.xspec. If Oxygen is installed on Windows in the Program Files folder for you, you must copy the entire "samples/xspec" folder to a place where you have full access rights.
3) Use the toolbar "Run XSpec Test Scenarios" button to run the tests and display the results in the XSpec Helper view. This seems to be working for me.

Then I got an Oxygen 20.1, did the same things and it also worked for me.

I get a similar problem with yours when trying to run the XSpec scenario over the webinar's "xslt_unit_testing/samples/xslt/books_test.xspec", the XSLT stylesheet is invalid, this line in the books.xsl:

Code: Select all

<span>by <xsl:value-of select="book/author"/></span>
should have been in my opinion:

Code: Select all

<span>by <xsl:value-of select="$book/author"/></span>
After making this correction things should work.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Oleksii
Posts: 84
Joined: Wed Jul 19, 2017 6:04 pm
Location: Austria
Contact:

Re: XSpec error

Post by Oleksii »

Now it works. It seems that if there are any problems with XSLT you get that error, which is not very descriptive on my opinion.

The link in OXYGEN_INSTALL_DIR/samples/xspec/xslt/escape-for-regex.xspec:

http://code.google.com/p/xspec/wiki/GettingStarted

is outdated and should be probably:

https://github.com/expath/xspec/wiki/Getting-Started
Kind regards,
Oleksii Sapov-Erlinger
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: XSpec error

Post by alex_jitianu »

Hi,

I've updated the link to the Wiki to https://github.com/xspec/xspec/wiki/Getting-Started . XSPec was forked awhile ago from EXPath and developed independently.

XSpec execution is basically the execution of an ANT transformation. When it fails, the results log should provide help to understand what's happening. The way XSpec works though, by creating a driver XSLT that imports the original XSLT, errors in the original XSLT might be harder to understand.

Best regards,
Alex
Post Reply