Re: How is ambiguity defined?

> Constructing 54 trees and doing deep-equal on them (for some definition
> of “deep and “equal”) seems like it might be expensive. 
I agree that deciding if ambiguous parses produce the same serialization is way too much work to require implementations to do.

Detecting that there *is* an ambiguity is on the other hand cheap (it's just a tree walk), and is valuable information as well (since ambiguous parses take longer to produce).

Although the spec requires @xml:state="ambiguous" on the root, it would also be possible to put it on ambiguous sub-nodes during serialization at nearly no extra cost.

Steven

Received on Thursday, 6 January 2022 12:38:30 UTC