- From: G. Ken Holman <gkholman@CraneSoftwrights.com>
- Date: Mon, 02 Mar 2026 07:20:19 -0500
- To: Norm Tovey-Walsh <norm@saxonica.com>, "Graydon Saunders" <graydonish@fastmail.com>
- Cc: public-ixml@w3.org
I brought up something in the Q&A of my presentation that is one of the minor drawbacks of despatching the parsing from within XSLT. When a grammar is violated on input, the line/column information is useful as a diagnostic to feed back to the lay user. When a grammar is violated in a "sub-parse"(?) then that line/column information is in the context of that despatch. There is no line/column information being conveyed in the original parse that gives context to diagnostic information coming from despatching. I mentioned in my slide that foreign namespace annotations in the output from the original parse can give context for multiple purposes, especially in the case where I would be despatching a block of user input for further analysis. But what we have certainly is valuable! I'm just trying to create an environment for lay users where I can do as much handholding as I can. At 02/03/2026 09:54 +0000, Norm Tovey-Walsh wrote: >"Graydon Saunders" <graydonish@fastmail.com> writes: >> So I can see an extension of that approach where you would want to switch parsers as well as grammars > >I think one reasonable approach for “different grammars in different contexts†is to use XPath (in 4.0) or XSLT (with CoffeeSacks, for example) to select the context in XPath/XSLT then parse with the grammar you want. > >That said, I still want to experiment with allowing grammar authors to do this directly. To have a grammar that matches “big complicated thing†with a simple rule and then passes the matched thing off to a different grammar to parse its structure. Not because it’s impossible to do this in one grammar but because it might be a lot easier for authors if they could keep them separate. > > Be seeing you, > norm > >-- >Norm Tovey-Walsh >Saxonica -- Contact info, blog, articles, etc. http://www.CraneSoftwrights.com/i/ | Check our site for free XML, XSLT, XSL-FO and UBL developer resources | Streaming hands-on XSLT/XPath 2 training class @US$50 (5 hours free!) | Essays (UBL, XML, etc.) http://www.linkedin.com/today/author/gkholman |
Received on Tuesday, 3 March 2026 18:15:04 UTC