Re: Adding xsl:note to the schema for XSLT 4.0

Thanks for the inquiry; I will look into it and see what I can do.  But
I think the best way to manage this is to make the change in the Relax
NG schema written by Mohammed Zergaoui and then generate the XSD from
that, using trang.  At least, I believe that's the way the current XSD
schema for XSL was made.

I don't seem to be able to find a current email address for Mohammed on
my current machine.  But if we can reach him, it would be good to
consult him.

Michael


Michael Kay <mike@saxonica.com> writes:

> A question for XSD experts and in particular for Michael Sperberg-McQueen!
>
> I'm struggling to work out how to add xsl:note to the schema for XSLT 4.0.
>
> The rule is simply: an xsl:note element can appear anywhere (as a descendant of xsl:stylesheet | transform | package).
>
> It's easy enough to add it to the substitution group for instructions and declarations.
>
> What's difficult is handling things like xsl:for-each, whose content
> model is currently (xsl:sort* instruction*). Handling each such case
> independently is really hard work.
>
> One possibility is to use xs:defaultOpenContent mode="interleave", but
> that doesn't allow me to nominate a permitted list of names that may
> appear, only a list of names that must not appear.
>
> The best I can come up with is
>
> <xs:defaultOpenContent mode="interleave" appliesToEmpty="true">
>   <xs:any processContents="strict" namespace="##targetNamespace" notQName="xsl:accept xsl:accumulator xsl:accumulator-rule ...."/>
> </xsLdefaultOpenContent>
>
> That is, in order to allow xsl:note to appear anywhere, I allow any of
> the 85 global elements in the XSLT namespace to appear anywhere,
> except for the 84 that are explicitly disallowed.
>
> Another option would be to use
>
> <xs:defaultOpenContent mode="interleave" appliesToEmpty="true">
>   <xs:any processContents="lax" namespace="##targetNamespace"/>
> </xsLdefaultOpenContent>
>
> with an assertion at the xsl:stylesheet level that if any descendant in the XSLT namespace has a type of xs:anyType then its name must be xsl:note.
>
> Any better suggestions?
>
> Michael Kay
> Saxonica


-- 
C. M. Sperberg-McQueen
Black Mesa Technologies LLC
http://blackmesatech.com

Received on Friday, 23 June 2023 17:31:45 UTC