* xmlTextReaderConstXmlVersion: * @reader: the xmlTextReaderPtr used * * Determine the XML version of the document being read. * * Returns a string containing the XML version of the document or NULL * in case of error. The string is deallocated with the reader. */
| 4570 | * in case of error. The string is deallocated with the reader. |
| 4571 | */ |
| 4572 | const xmlChar * |
| 4573 | xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader) { |
| 4574 | xmlDocPtr doc = NULL; |
| 4575 | if (reader == NULL) |
| 4576 | return(NULL); |
| 4577 | if (reader->doc != NULL) |
| 4578 | doc = reader->doc; |
| 4579 | else if (reader->ctxt != NULL) |
| 4580 | doc = reader->ctxt->myDoc; |
| 4581 | if (doc == NULL) |
| 4582 | return(NULL); |
| 4583 | |
| 4584 | if (doc->version == NULL) |
| 4585 | return(NULL); |
| 4586 | else |
| 4587 | return(constString(reader, doc->version)); |
| 4588 | } |
| 4589 | |
| 4590 | /** |
| 4591 | * xmlTextReaderStandalone: |
nothing calls this directly
no test coverage detected