Getting started with XSpec

Here should go questions about transforming XML with XSLT and FOP.
EJB
Posts: 12
Joined: Mon Dec 13, 2010 12:59 pm

Getting started with XSpec

Post by EJB »

Hi, I watched the recent Part 3 Webinar (http://www.youtube.com/watch?v=4O2DaFxE9qE) and looked at the help (http://www.oxygenxml.com/doc/ug-editorE ... xspec.html). They're both fine on how to set up a set of XSpec unit tests, and I am keen to get started, but they are both a bit vague about how you actually get the tests to run.

After creating my XSpec unit test using the wizard, if I click on the Apply Transformation Scenario(s) button, I am prompted to choose a transformation scenario. If I choose the one associated with the stylesheet under test, which is configured to apply the XSLT stylesheet to ${currentFileURL}, I get the following warning and nothing else happens:

"The source document is in namespace http://www.jenitennison.com/xslt/xspec, but all the template rules match elements in no namespace"

I think I'm missing a crucial step somewhere along the line, so I welcome any suggestions on how the transformation scenario should be set up. Cheers!
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Getting started with XSpec

Post by alex_jitianu »

Hi Emma,

So the first step is to create the *.xspec file, which you did. Next, it must be open in an editor. Before running the transformation you should save it (if you've created using the New... then you have an untitled editor). Clicking on the Apply Transformation Scenario(s) (while being in the *.xspec editor) should run the test unit automatically, there should be no need for you to select a transformation scenario (there's a built-in scenario already created and associated).

From your description it looks like you tried to apply the XSL you want to test over the XSPEC file. Like I've said there is a specific XSPEC scenario named XSpec for XSLT that should be applied over the *.xspec file.

Best regards,
Alex
EJB
Posts: 12
Joined: Mon Dec 13, 2010 12:59 pm

Re: Getting started with XSpec

Post by EJB »

Hmm, I have disassociated my saved .xspec file from any transformation scenario, just as it was when I first created it, but when I click on Apply Transformation Scenario(s), the Transform with dialogue comes up, prompting me to choose an existing transformation scenario.

Looks as if I must be missing something?
EJB
Posts: 12
Joined: Mon Dec 13, 2010 12:59 pm

Re: Getting started with XSpec

Post by EJB »

Aha. Dodgy frameworks folder. I reset it to the default from the one it had picked up from a previous installation and now the Apply Transformation Scenario(s) button works as you described.

It would still be a good idea to make it explicit in the help how it is supposed to work, as without that information, I couldn't be sure whether I was doing something wrong or something was wrong. Once I knew what the correct behaviour was, it was much easier to troubleshoot!

Thanks!
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Getting started with XSpec

Post by alex_jitianu »

Hi,

Good to hear you found the culprit. I've already added an issue to review the documentation so hopefully this confusion will not rise again.

Thank you,
Alex
Post Reply