Xspec - why my test is failed?

Post here questions and problems related to oXygen frameworks/document types.
jvanhille
Posts: 8
Joined: Tue Jan 27, 2015 2:36 pm

Xspec - why my test is failed?

Post by jvanhille »

Hi,

I used to Xspec in Oxygen and I don't understand why my scenario is failed. Like you can see

My scenario :

Code: Select all

 
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec" stylesheet="tests_common_ESM.xsl">
<x:scenario label="Conversion NOTE">
<x:scenario label="Scenario conversion NOTE élément">
<x:context href="fragment_xml_test/test_note.xml"/>
<x:expect label="résultat" href="fragment_xml_test/test_note_expected.xml"/>
</x:scenario>
<x:scenario label="Scenario conversion NOTE élément dans listItem">
<x:context href="fragment_xml_test/test_note2.xml"/>
<x:expect label="résultat" href="fragment_xml_test/test_note2_expected.xml"/>
</x:scenario>
</x:scenario>

Screenshot :
https://drive.google.com/file/d/0B-GRA1 ... sp=sharing

On the screenshot the xml result and the xml expected seems equal (all is green). I have just remark the difference that I put in yellow.

I had this problem when I put the xml outside of my scenario (in test_note.xml and test_note_expected.xml for example)

What do you think about it ?

Please don't hesitate if you need more informations.

Thanks in advance
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Xspec - why my test is failed?

Post by radu_pisoi »

Hi,

I have investigated a bit the XSpec transformation and it seems that the cause why the test fails is that the type of the compared nodes is different. The result of the transformation is an element while the expected result is a document node.

A solution is to specify the select attribute on the expect element in order to select the root element of the expected result document.

Code: Select all

<x:expect label="résultat" href="fragment_xml_test/test_note2_expected.xml" select="/*"/>
Let me know if this solution works for you.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
jvanhille
Posts: 8
Joined: Tue Jan 27, 2015 2:36 pm

Re: Xspec - why my test is failed?

Post by jvanhille »

Hi Radu,

It works.

Thank you very much.
Post Reply