You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a scenario that asks xspec to transform a document first and then
test the output, xspec's transformation is generating the wrong result (or I am
using it wrong).
This is a sample scenario:
<x:scenario label="Scenarios for testing Choice handling" focus="Working out Choice handling">
<x:context href="NEHTA-00009-Adverse_Reaction-Structure (sample data).xml" select="/"></x:context>
<x:expect label="Abstract class in the uml:Model with an isAbstract attribute">
<packagedElement></packagedElement>
</x:expect>
</x:scenario>
The source transformation has this message in it to test that a variable was
created right:
<xsl:message select="concat('The package name is: ',
$packagename)"></xsl:message>
And the variable is defined as:
<xsl:variable name="packagename"
select="concat(/ci-spec:DataGroup/ci-spec:Specification/@name, ' v',
/ci-spec:DataGroup/ci-spec:Specification/@version, ' draft ',
/ci-spec:DataGroup/ci-spec:Specification/@draft-nr )"></xsl:variable>
The transformation, when run with Saxon-HE within oXygen, works fine. It also
works fine when I used the same version of Saxon manually just to confirm.
However, using xspec within oxygen 14.2, the output that I get is:
The package name is: v draft
Which indicates a problem (and has many more). I created another transformation
in Oxygen that used Saxon-HE instead of Saxon-EE - same error. I then ran xspec
0.4-rc1 manually using the same saxon-he version, and it had the same problem.
Same deal with 0.3.
So either I'm really not using xspec right, or it is having issues applying a
transformation properly. I wondered if the problem is with namespaces, but that
didn't seem to affect anything.
This is the template that gets generated for this scenario:
<xsl:template name="x:d4e39">
<xsl:message>Scenarios for testing Choice handling</xsl:message>
<x:scenario>
<x:label>Scenarios for testing Choice handling</x:label>
<x:context href="file:/C:/Users/VadimPeretokin/Desktop/dcm2ea/NEHTA-00009-Adverse_Reaction-Structure%20(sample%20data).xml"
select="/"/>
<xsl:variable name="x:result" as="item()*">
<xsl:variable name="impl:context-doc"
as="document-node()"
select="doc('file:/C:/Users/VadimPeretokin/Desktop/dcm2ea/NEHTA-00009-Adverse_Reaction-Structure%20(sample%20data).xml')"/>
<xsl:variable name="impl:context" select="$impl:context-doc/(/)"/>
<xsl:apply-templates select="$impl:context"/>
</xsl:variable>
<xsl:call-template name="test:report-value">
<xsl:with-param name="value" select="$x:result"/>
<xsl:with-param name="wrapper-name" select="'x:result'"/>
<xsl:with-param name="wrapper-ns" select="'http://www.jenitennison.com/xslt/xspec'"/>
</xsl:call-template>
<xsl:call-template name="x:d4e41">
<xsl:with-param name="x:result" select="$x:result"/>
</xsl:call-template>
</x:scenario>
</xsl:template>
<xsl:template name="x:d4e41">
<xsl:param name="x:result" required="yes"/>
<xsl:message>Abstract class in the uml:Model with an isAbstract attribute</xsl:message>
<xsl:variable name="impl:with-context"
select=" exists($x:result) and empty($x:result[2])"/>
<xsl:variable name="impl:context" as="item()?">
<xsl:choose>
<xsl:when test="$impl:with-context">
<xsl:sequence select="$x:result"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:variable>
<xsl:variable name="impl:expected-doc" as="document-node()">
<xsl:document>
<packagedElement/>
</xsl:document>
</xsl:variable>
<xsl:variable name="impl:expected" select="$impl:expected-doc/node()"/>
<xsl:variable name="impl:successful"
as="xs:boolean"
select=" test:deep-equal( $impl:expected, if ( $impl:with-context ) then $impl:context else $x:result, 2)"/>
<xsl:if test="not($impl:successful)">
<xsl:message> FAILED</xsl:message>
</xsl:if>
<x:test successful="{ $impl:successful }">
<x:label>Abstract class in the uml:Model with an isAbstract attribute</x:label>
<xsl:call-template name="test:report-value">
<xsl:with-param name="value" select="$x:result"/>
<xsl:with-param name="wrapper-name" select="'x:result'"/>
<xsl:with-param name="wrapper-ns" select="'http://www.jenitennison.com/xslt/xspec'"/>
</xsl:call-template>
<xsl:call-template name="test:report-value">
<xsl:with-param name="value" select="$impl:expected"/>
<xsl:with-param name="wrapper-name" select="'x:expect'"/>
<xsl:with-param name="wrapper-ns" select="'http://www.jenitennison.com/xslt/xspec'"/>
</xsl:call-template>
</x:test>
</xsl:template>
Original issue reported on code.google.com by [email protected] on 13 Aug 2013 at 1:43
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 13 Aug 2013 at 1:43The text was updated successfully, but these errors were encountered: