Re: [xsl] inserting a child element while honoring the parent element's content model

Subject: Re: [xsl] inserting a child element while honoring the parent element's content model
From: "Wendell Piez wapiez@xxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Feb 2023 13:14:59 -0000
Mike,

So interesting! Thank you. The list never ceases to deliver up treasures.

Cheers, Wendell


On Wed, Feb 22, 2023 at 4:37 AM Michael Kay michaelkay90@xxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> >
> > With respect to *testing* against (not processing in view of) content
> models - I hesitate to mention it but there is the approach of writing out
> the sequence of element names as a string and then testing that against a
> regex mapped out from the content model. One of several problems with this
> approach is that the error messages it produces are pretty useless.Limiting
> the content model in certain ways can make this easier e.g. forbidding
> repeated sequence groups (even worse than 'or' groups).
> >
>
> In 2018, in https://www.saxonica.com/papers/markupuk-2018mhk.pdf
>
> I described how you could write a schema validator in XSLT 3.0. It uses
> the finite state machines in an SCM file generated by a Java schema
> processor; I never got around to writing the other half of the system (the
> schema compiler that generates the FSM) in XSLT, but it's certainly doable.
>
> The actual testing of a sequence of elements against the FSM is
> implemented using xsl:iterate and is very straightforward - see section 4.3
> of the paper.
>
> Michael Kay
> Saxonica
> 
>
>

-- 
...Wendell Piez... ...wendell -at- nist -dot- gov...
...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
...github.com/wendellpiez... ...gitlab.coko.foundation/wendell...

Current Thread