[xml] xmlTextReaderSetSchema and dynamic setting of the schema



I'd like to check my understanding:

According to the documentation, if you want to have an xmlTextReader do schema validation, you have to set the schema before the first read call on the text reader.

HOWEVER, if you are trying to make a reader routine which can handle multiple document types, you don't know the doc type until you've read the DOCTYPE element, which you don't know until you've done a Read on the Reader - which makes it too late to activate a schema.

So as I read it, there is no way to read the first 2 lines of a stream (which may not be seekable), deduce the schema needed from the DOCTYPE record, then activate the appropriate schema.

Is this a correct assessment?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]