Q:

In XSLT 2.0 inside of a predicate how can I compare an attribute that has a namespace?

I have the following partial xpath expression
IAAXML:party[@xsi:type='IAAXML:Organization']

My source XML is:
<IAAXML:party xsi:type="IAAXML:Organization">

With the namespace declared as such:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

I get the following error:
The operand types are not compatible for the = operator

How do I do a compare on that attribute using the namespace?

A:

JLRishe has essentially given you the answer, but I'll amplify it. The xsi:type attribute is of type QName. In a schema-aware processor, your comparison is therefore a typed comparison between a QName and a string, which for very good reasons isn't allowed. After all, your application logic shouldn't really depend on the fact that the source document uses the namespace prefix IAAXML rather than some other prefix of the author's choosing. Given that you've got a type-aware processor, it would be better to do a QName comparison:
[@xsi:type = QName("http://the-iaaxml-namespace/", "Organization")]

