>> B. If A's support for legacy encodings is deemed inadequate, could we
>> piggyback on top of XML's support by defining a simple one element
>> wrapper for RNC?
>
> The trouble with this is that RNG/RNC autodetection becomes much more
> complex than just checking for "<" after possible whitespace.
Yes. Effectively you would have 3 syntaxes:
A. Standard XML syntax
B. Compact syntax with XML wrapper
C. Compact syntax without XML wrapper
The first stage would be to distinguish between A/B and C. This you would
do at the byte stream level. The second stage would be to distinguish A
and B. This you would do at the XML level, e.g. with a SAX filter that
forwards to one of two SAX ContentHandlers based on the name of the first
element.
The other complication with the XML wrapper approach is error reporting.
It becomes hard/impossible to reliably report line/column info for
individual tokens. SAX just gives you the line/column of the last
character in a chunk. Also with SAX you would end up having to read in the
whole schema before passing it to the compact syntax parser.
Overall, I tend to agree that you won't save any implementation complexity
by doing this. On the other hand, you do still save specificational
complexity.
James