Page 1 of 1

XSpec error

Posted: Mon Aug 30, 2021 5:50 pm
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

Re: XSpec error

Posted: Tue Aug 31, 2021 8:20 am
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

Re: XSpec error

Posted: Tue Aug 31, 2021 12:07 pm
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

Re: XSpec error

Posted: Mon Sep 06, 2021 8:25 am
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