Subject: Re: [xsl] inserting a child element while honoring the parent element's content model From: "Lizzi, Vincent vincent.lizzi@xxxxxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 22 Feb 2023 20:34:49 -0000 |
>> 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). This might be straying from the original topic, but I can say that Ibve used the approach that Wendell mentioned and been happy with the results. The error messages can be better than the typical error messages that one sees from validating against a DTD or XSD. I used a subset of RelaxNG to describe the content models which was transformed by XSLT into regular expressions and error messages that were then used in Schematron. If anyone is interested in more detail about this implementation let me know. Cheers, Vincent _____________________________________________ Vincent M. Lizzi Head of Information Standards | Taylor & Francis Group vincent.lizzi@xxxxxxxxxxxxxxxxxxxx<mailto:vincent.lizzi@xxxxxxxxxxxxxxxxxxxx> From: Wendell Piez wapiez@xxxxxxxxxxxxxxx<mailto:wapiez@xxxxxxxxxxxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx rytech.com>> Sent: Tuesday, February 21, 2023 6:10 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: Re: [xsl] inserting a child element while honoring the parent element's content model Hey Chris (writing from a different address here), Exactly - I think we already touched on this thread how the union operator (a|b|c) has the effect of sorting in document order? In passing I am noting the difference between (a|b|c)[1]/(.|preceding-sibling::node()) and without that [1] positional predicate. Going to be quite a bit different. 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). Cheers, Wendell Information Classification: General
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] inserting a child element, Wendell Piez wapiez@ | Thread | Re: [xsl] inserting a child element, Chris Papademetrious |
Re: [xsl] inserting a child element, Wendell Piez wapiez@ | Date | Re: [xsl] inserting a child element, Chris Papademetrious |
Month |