This works in XMLSPy but not in oXygen 21 with Saxon 12.5:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:variable name="x" select="('a', 'b')" as="xs:string+" />
<xsl:variable name="y" select="('b', 'c')" as="xs:string+"/>
<xsl:variable name="a_exc_y" select="$x except $y"/>
</xsl:stylesheet>
Error in oXygen is:
The required item type of the first operand of 'except' is node(). The supplied value is an atomic value.
I initially built the list of strings from element attributes, but I simplified it to static lists, but nothing helps.
I have tried using data($x), I've tried type casting to xs:anyAtomicValue* but nothing gets me past this error/warning in oXygen. Should this not be possible?
Update: XMLSpy doesn't work either. One could save the file without errors, but when running a test, the same type of error presented itself. So it seems like one cannot use set operations on sequences of strings?
exceptwas new in XPath 2.0 but was introduced together withintersectin addition to e.g.|orunionand is defined for sequences of nodes. I don't think XPath 3.1 has something for sequences of atomic values or mixed sequences, with XPath 4.0 those operators will be generalized to GNodes qt4cg.org/specifications/xquery-40/xpath-40.html#combining_seq but my current understanding is that means maps and arrays (converted to GNodes) in addition to XML nodes.('a', 'b')[not(. = ('b', 'c'))]should do, otherwise (if you want removal of duplicates) you need('a', 'b')[not(. = ('b', 'c'))] => distinct-values().