You might be able to find a different XML Schema processor that expands the
fixed attribute values in a preprocessing phase, but if you want this all to
work seamlessly in Saxon then you'll need the Saxon schema processor which
requires a Saxon-EE license.
It needs an XML Schema (XSD) processor, not just an XML parser.
Michael Kay
Saxonica
> On 8 Oct 2026, at 06:04, Trevor Nicholls trevor@xxxxxxxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> XSL2, currently using Saxon 10 HE as the XSL processor, with its default
> XML parser
>
> I'm trying to add a couple of fixed attributes to my XML schema so that
> I can simplify a number of long-winded tests in some of my transforms.
>
> So for example I modified the schema so that a large number of\xA0 elements
> include
>
> <xs:attribute name="block" fixed="Y" />
>
> in their definition. (Extensions mean this is a one-liner edit to the
> XSD, hooray).
>
> I'm sure you know what's coming next :-(
>
> I was hoping that this would allow something like this in my XSL:
>
> <xsl:choose>
> \xA0 <xsl:when test="ancestor::*[@block = 'Y']"> ... </xsl:when>
> \xA0 <xsl:otherwise> ... </xsl:otherwise>
> </xsl:choose>
>
> instead of having an enormous qualifier explicitly testing dozens of
> possible element names.
>
> So this isn't working. I can see that I need a Saxon EE license for
> "full schema-awareness", but so far as I can tell this isn't a question
> of full schema awareness in the XSL processor, but a requirement for an
> XML parser which recognises the fixed attributes. I may be interpreting
> the Saxon documentation naiively, but it looks to me as though I should
> be able to achieve what I want within Saxon HE so long as I have an
> appropriate parser (and apparently this is not the default used by
> Saxon). Is there such a parser available?
>
> I do have the last resort option of transforming all of the documents so
> that these attributes are included in-place in the XML, but I'm hoping I
> don't need to do that.\xA0
>
> Is there a way to achieve what I want or is a Saxon EE license the only
> way to get there?
>
> cheers
> T\xA0
|