Re: XPath support for using multiple ixml implementations

On 3/3/2026 10:52 AM, Norm Tovey-Walsh wrote:
>>  From Sheila's presentation what I understood about the differences between the implementations is that, above all, Gunther Rademacher's Markup Blitz seems to have implemented some 'magic' disambiguation logic, which produces desirable (and in some way expected) results.
> 
> No, I don’t think that’s what’s happening. Given an ambiguous parse, the processor has to pick one. It just happens that Markup Blitz and NineML choose different parses and, for Sheila’s application, the arbitrary choice that Markup Blitz made worked better than the arbitrary choice NineML made.

No, the behavior in Markup Blitz is neither “magic” nor purely arbitrary.

When Markup Blitz encounters an ambiguity, it maintains, for each 
alternative, a queue of deferred actions. An action in this sense is the 
completion of a terminal or nonterminal that will eventually be 
delivered into the parse tree. Among competing alternatives, Markup 
Blitz selects one with the smallest number of pending actions.

Operationally, this corresponds to choosing an alternative that requires 
the fewest derivation steps. In practice, this typically results in the 
most compact parse tree. I have found that this strategy aligns well 
with my own expectations, and my understanding is that others share this 
assessment.

For reference, the relevant code is here:
https://github.com/GuntherRademacher/markup-blitz/blob/9481b2f295110174978796dbcaf33603a46f20a5/src/main/java/de/bottlecaps/markup/blitz/Parser.java#L730-L731

Best regards
Gunther

Received on Tuesday, 3 March 2026 13:12:24 UTC