XSLTのXSpecを使ってこの単純なコードをテストする方法を知っている人はいますか? XSPECを使用してどのようにXspecユニットのテストを実装するには?
<xsl:template match="@NameTitle">
<NameTitle Value="{if(. = ('Sir', 'Lady', 'Hon', 'R Hon')) then 'Other' else .}"
Description="{if(. = ('Sir', 'Lady', 'Hon', 'R Hon')) then . else ''}"/>
</xsl:template>
<xsl:template match="BusinessChannel/Contact/ContactPerson | SalesChannel/LoanWriter">
<PersonName>
<xsl:apply-templates select="@NameTitle"/>
<FirstName>
<xsl:value-of select="@FirstName"/>
</FirstName>
<Surname>
<xsl:value-of select="@Surname"/>
</Surname>
</PersonName>
</xsl:template>
は、ビューの初心者の観点から機能をテストするための単純であるが、属性を選択テンプレートの(今、私はそれを使用し始めているので、現時点では、少なくとも私にとっては)ないです。
例:これは簡単だった:
<xsl:function name="fn:RemoveSpace">
<xsl:param name="RemoveSpace"/>
<xsl:if test="$RemoveSpace != ''">
<xsl:value-of select="translate($RemoveSpace, ' ', '')"/>
</xsl:if>
</xsl:function>
<x:scenario label="Scenario for testing function RemoveSpace">
<x:call function="fn:RemoveSpace">
<x:param name="RemoveSpace" select="'Person Applicant'"/>
</x:call>
<x:expect label="Remove the white space">PersonApplicant</x:expect>
</x:scenario>
任意の提案は大歓迎です。 P.P.私はOxygenXMLのXspecを使用しています。 https://github.com/expath/xspec/wiki/Writing-Scenarios#matching-scenariosとhttps://github.com/expath/xspec/wiki/Writing-Scenarios#expectationsに基づいて