Xspec - why my test is failed?

Post here questions and problems related to oXygen frameworks/document types.
jvanhille
Posts: 8

Xspec - why my test is failed?

Thu Oct 08, 2015 12:21 pm

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-GRA1J6xnzNbGdvelJ3RlU1aGM/view?usp=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: 327
Location: Craiova

Re: Xspec - why my test is failed?

Fri Oct 09, 2015 12:24 pm

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

Re: Xspec - why my test is failed?

Fri Oct 09, 2015 12:31 pm

Hi Radu,

It works.

Thank you very much.

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest