Hi Hans-Juergen,

The code in question "$baseType is element(xs:simpleType)" looks like you really want to test that $baseType is a instance of the xs:simpleType instead of a node identity test, which would be incorrect.
Your code would work if you replace 'is' with 'instance of' or even '$baseType[self::xs:simpleType]'

On 01/11/11 23:08, Hans-Juergen Rennau wrote:
Hello O'Neil,
probably this is again the same bug already reported and fixed. You wrote:
"Thanks very much for reporting the bug, which has now been noted (sourceforge Bug report ID: 3419499) and the bug is now fixed, which will appear in the next patch release."
But as I am not sure I report it again, as now the context is slightly different (stylesheet vs. query).
Summry: if (element(elemName)) does not match when it should; but the equivalent comparison of node names matches.
The earlier report stated:
"But this, of course, only in a very special context, which is given by how the candidate is provided:
   $def/(* except xs:annotation)
Whereas now I observe the problem in a stylesheet - see below for a snippet. Please just ignore this posting if you are sure the bug is fixed (in which is not yet available for HE).
Kind regards from
-- Hans-Juergen
Snippet: The when-test fails when I remove the third alternative (... or local-name($baseType) ..."):
   <xsl:variable name="baseType" as="element()?">
      <xsl:variable name="baseTypeQName" select="(xs:extension, xs:restriction)/resolve-QName(@base, .)"/>
      <xsl:sequence select="$xsds/(xs:simpleType, xs:complexType)[QName(ancestor::xs:schema/@targetNamespace, @name) eq $baseTypeQName]"/>
      <xsl:when test="not($baseType)
                      or $baseType is element(xs:simpleType)
                      or local-name($baseType) eq 'simpleType' and namespace-uri($baseType) eq 'http://www.w3.org/2001/XMLSchema'">

RSA&#174; Conference 2012
Save $700 by Nov 18
Register now&#33;

saxon-help mailing list archived at http://saxon.markmail.org/

O'Neil Delpratt
Software Developer, Saxonica Limited
Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com