Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing an attribute scenario generates error in unit-report-oxygen.xsl #41

Closed
jd-nictiz opened this issue Jun 9, 2020 · 1 comment
Closed

Comments

@jd-nictiz
Copy link

jd-nictiz commented Jun 9, 2020

Hi,

Given the following named template:

<xsl:template name="code-to-code" as="attribute()+">
        <xsl:param name="value" as="attribute(value)" select="."/>
        <xsl:param name="codeMap" as="element()*"/>
               
        <xsl:variable name="out" as="element()">
            <xsl:choose>
                <xsl:when test="$codeMap[@inValue = $value]">
                    <xsl:copy-of select="$codeMap[@inValue = $value]"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:copy-of select="."/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        
        <xsl:attribute name="code" select="$out/@code"/>
        <xsl:attribute name="codeSystem" select="$out/@codeSystem"/>
        <xsl:if test="$out/@displayName">
            <xsl:attribute name="displayName" select="$out/@displayName"/>
        </xsl:if>
    </xsl:template>

with the following scenario:

<x:scenario label="template name code-to-code">
            <x:call template="code-to-code">
                <x:param name="value" select="f:gender/@value">
                    <f:gender value="female"/>
                </x:param>
                <x:param name="codeMap">
                    <map code="F" codeSystem="null" inValue="female" displayName="Vrouw"/>
                </x:param>
            </x:call>
            <x:expect label="attributes" select="geslacht/@*">
                <geslacht code="F" codeSystem="null" displayName="Vrouw"/>
            </x:expect>
        </x:scenario>

The test succeeds and everything goed as planned. However, when I change the expect to fail the scenario:

<x:expect label="attributes" select="geslacht/@*">
                <geslacht code="false" codeSystem="2.16.840.1.113883.5.1" displayName="Vrouw"/>
            </x:expect>

The following error is raied in unit-report-oxygen.xsl:
[xslt] [...]\xspec.support-1.6.0\oxygen-results-view\unit-report-oxygen.xsl:192:0: Fatal Error! Cannot create an attribute node (code) whose parent is a document node. Most recent element start tag was output at line -1 of module *unknown*
Please let me know if I can clarify something.

@AlexJitianu
Copy link
Collaborator

Hi,

Thank you for reporting this issue. I've released a new version, 1.6.1, that fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants