xsl-list
[Top] [All Lists]

Re: [xsl] fn:contains in sequence – P2 | XSLT 2.0

2021-06-24 10:53:29

Am 24.06.2021 um 16:47 schrieb Fiona Chen anonymousjuly1(_at_)yahoo(_dot_)ca:
    However, I am not able to transform the report in XSLT 2.0
equivalent without MarkLogic cts.

<xsl:template match="SVM">
<xsl:variable name="classVal" select="class[/xs:decimal/(/@val/) gt
0.00]"/>
<xsl:element name="SVM" namespace="schema://fc.fasset/svm">
<xsl:comment select="$point-in-time"/>
<xsl:element name="Negative" namespace="schema://fc.fasset/svm">
<xsl:comment select="$negative-comment"/>
<xsl:for-each
select="classification[/not/(/contains/(descendant::label, $classVal))]">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:element>
</xsl:element>
</xsl:template>


 (Note: The number, position and sequence of the labelled class will
change depending on the training data. Hard-coded count or position in
XSLT wouldn’t work.)

    I receive either blank result or Saxon fetal error to that
effect:A sequence of more than one item is not allowed as the second
argument of fn:contains()


I think the error message is telling you that that the second argument
to the "contains" call, i.e. $classVal is a sequence of more than one item.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>