xsl unit testing (java)

173 views Asked by At

The output of xsl is "xml"

Is there a way we can have a sample XML and compare it with the output of the XSLT ? could someone please give me an example on how to write unit test for the below.

<xsl:variable name="variableA">
            <xsl:choose>
                <xsl:when test="normalize-space(field1)='1' and $variableB and
                                (translate(normalize-space($variableC), $ucletters,$lcletters)='x' or
                                translate(normalize-space($variableC), $ucletters,$lcletters)='y')">
                    <xsl:text>5</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:text>6</xsl:text>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
1

There are 1 answers

0
Michael Kay On

Take a look at the XSpec unit testing framework.