2002-12-09 14:13:43 +00:00
|
|
|
/*
|
|
|
|
* xmlreader.h : Interfaces, constants and types of the XML streaming API.
|
|
|
|
*
|
|
|
|
* See Copyright for the status of this software.
|
|
|
|
*
|
|
|
|
* daniel@veillard.com
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __XML_XMLREADER_H__
|
|
|
|
#define __XML_XMLREADER_H__
|
|
|
|
|
2003-08-25 09:05:12 +00:00
|
|
|
#include <libxml/xmlversion.h>
|
2002-12-09 14:13:43 +00:00
|
|
|
#include <libxml/tree.h>
|
|
|
|
#include <libxml/xmlIO.h>
|
2003-04-17 09:09:19 +00:00
|
|
|
#ifdef LIBXML_SCHEMAS_ENABLED
|
|
|
|
#include <libxml/relaxng.h>
|
|
|
|
#endif
|
2002-12-09 14:13:43 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2002-12-18 14:53:54 +00:00
|
|
|
typedef enum {
|
|
|
|
XML_PARSER_LOADDTD = 1,
|
2002-12-28 22:56:33 +00:00
|
|
|
XML_PARSER_DEFAULTATTRS = 2,
|
|
|
|
XML_PARSER_VALIDATE = 3,
|
|
|
|
XML_PARSER_SUBST_ENTITIES = 4
|
2002-12-18 14:53:54 +00:00
|
|
|
} xmlParserProperties;
|
|
|
|
|
2003-01-16 22:45:08 +00:00
|
|
|
typedef enum {
|
2003-01-20 21:26:34 +00:00
|
|
|
XML_PARSER_SEVERITY_VALIDITY_WARNING = 1,
|
|
|
|
XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
|
|
|
|
XML_PARSER_SEVERITY_WARNING = 3,
|
|
|
|
XML_PARSER_SEVERITY_ERROR = 4
|
|
|
|
} xmlParserSeverities;
|
2003-01-16 22:45:08 +00:00
|
|
|
|
2003-08-09 18:01:53 +00:00
|
|
|
typedef enum {
|
2003-07-30 16:37:18 +00:00
|
|
|
XML_READER_TYPE_NONE = 0,
|
|
|
|
XML_READER_TYPE_ELEMENT = 1,
|
|
|
|
XML_READER_TYPE_ATTRIBUTE = 2,
|
|
|
|
XML_READER_TYPE_TEXT = 3,
|
|
|
|
XML_READER_TYPE_CDATA = 4,
|
|
|
|
XML_READER_TYPE_ENTITY_REFERENCE = 5,
|
|
|
|
XML_READER_TYPE_ENTITY = 6,
|
|
|
|
XML_READER_TYPE_PROCESSING_INSTRUCTION = 7,
|
|
|
|
XML_READER_TYPE_COMMENT = 8,
|
|
|
|
XML_READER_TYPE_DOCUMENT = 9,
|
|
|
|
XML_READER_TYPE_DOCUMENT_TYPE = 10,
|
|
|
|
XML_READER_TYPE_DOCUMENT_FRAGMENT = 11,
|
|
|
|
XML_READER_TYPE_NOTATION = 12,
|
|
|
|
XML_READER_TYPE_WHITESPACE = 13,
|
|
|
|
XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14,
|
|
|
|
XML_READER_TYPE_END_ELEMENT = 15,
|
|
|
|
XML_READER_TYPE_END_ENTITY = 16,
|
|
|
|
XML_READER_TYPE_XML_DECLARATION = 17
|
2003-08-09 18:01:53 +00:00
|
|
|
} xmlReaderTypes;
|
2003-07-30 16:37:18 +00:00
|
|
|
|
2002-12-09 14:13:43 +00:00
|
|
|
typedef struct _xmlTextReader xmlTextReader;
|
|
|
|
typedef xmlTextReader *xmlTextReaderPtr;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Constructors & Destructor
|
|
|
|
*/
|
2003-08-25 09:05:12 +00:00
|
|
|
XMLPUBFUN xmlTextReaderPtr XMLCALL
|
|
|
|
xmlNewTextReader (xmlParserInputBufferPtr input,
|
2002-12-20 00:16:24 +00:00
|
|
|
const char *URI);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN xmlTextReaderPtr XMLCALL
|
|
|
|
xmlNewTextReaderFilename(const char *URI);
|
|
|
|
XMLPUBFUN void XMLCALL
|
|
|
|
xmlFreeTextReader (xmlTextReaderPtr reader);
|
2002-12-09 14:13:43 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Iterators
|
|
|
|
*/
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderRead (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderReadInnerXml (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderReadOuterXml (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderReadString (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader);
|
2002-12-09 14:13:43 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Attributes of the node
|
|
|
|
*/
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderDepth (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderHasValue(xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderIsDefault (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
|
2003-09-19 12:44:05 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderNodeType (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderReadState (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderBaseUri (xmlTextReaderPtr reader);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderLocalName (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderName (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderPrefix (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderXmlLang (xmlTextReaderPtr reader);
|
2003-09-19 12:44:05 +00:00
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderValue (xmlTextReaderPtr reader);
|
2002-12-14 23:00:35 +00:00
|
|
|
|
2003-09-19 12:44:05 +00:00
|
|
|
XMLPUBFUN const xmlChar * XMLCALL
|
|
|
|
xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN const xmlChar * XMLCALL
|
|
|
|
xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN const xmlChar * XMLCALL
|
|
|
|
xmlTextReaderConstName (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN const xmlChar * XMLCALL
|
|
|
|
xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN const xmlChar * XMLCALL
|
|
|
|
xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN const xmlChar * XMLCALL
|
|
|
|
xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
|
2002-12-14 23:00:35 +00:00
|
|
|
/*
|
|
|
|
* Methods of the XmlTextReader
|
|
|
|
*/
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderClose (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
|
2002-12-14 23:00:35 +00:00
|
|
|
int no);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
|
2002-12-14 23:00:35 +00:00
|
|
|
const xmlChar *name);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
|
2002-12-14 23:00:35 +00:00
|
|
|
const xmlChar *localName,
|
|
|
|
const xmlChar *namespaceURI);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
|
|
|
xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
|
2002-12-15 23:36:49 +00:00
|
|
|
const xmlChar *prefix);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
|
2002-12-15 23:36:49 +00:00
|
|
|
int no);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
|
2002-12-15 23:36:49 +00:00
|
|
|
const xmlChar *name);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
|
2002-12-15 23:36:49 +00:00
|
|
|
const xmlChar *localName,
|
|
|
|
const xmlChar *namespaceURI);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderNormalization (xmlTextReaderPtr reader);
|
2002-12-15 23:36:49 +00:00
|
|
|
|
2002-12-18 14:53:54 +00:00
|
|
|
/*
|
|
|
|
* Extensions
|
|
|
|
*/
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
|
2002-12-18 14:53:54 +00:00
|
|
|
int prop,
|
|
|
|
int value);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
|
2002-12-18 14:53:54 +00:00
|
|
|
int prop);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN xmlNodePtr XMLCALL
|
|
|
|
xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlDocPtr XMLCALL
|
|
|
|
xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN xmlNodePtr XMLCALL
|
|
|
|
xmlTextReaderExpand (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderNext (xmlTextReaderPtr reader);
|
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderIsValid (xmlTextReaderPtr reader);
|
2003-04-15 23:32:22 +00:00
|
|
|
#ifdef LIBXML_SCHEMAS_ENABLED
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
|
2003-04-15 23:32:22 +00:00
|
|
|
const char *rng);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
|
2003-04-17 09:09:19 +00:00
|
|
|
xmlRelaxNGPtr schema);
|
2003-04-15 23:32:22 +00:00
|
|
|
#endif
|
2003-01-16 22:45:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Error handling extensions
|
|
|
|
*/
|
2003-01-20 21:26:34 +00:00
|
|
|
typedef void * xmlTextReaderLocatorPtr;
|
|
|
|
typedef void (*xmlTextReaderErrorFunc) (void *arg,
|
2003-01-16 22:45:08 +00:00
|
|
|
const char *msg,
|
2003-01-20 21:26:34 +00:00
|
|
|
xmlParserSeverities severity,
|
|
|
|
xmlTextReaderLocatorPtr locator);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN int XMLCALL
|
|
|
|
xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
|
2003-01-20 21:26:34 +00:00
|
|
|
/*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN xmlChar * XMLCALL
|
|
|
|
xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
|
|
|
|
XMLPUBFUN void XMLCALL
|
|
|
|
xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
|
2003-01-16 22:45:08 +00:00
|
|
|
xmlTextReaderErrorFunc f,
|
|
|
|
void *arg);
|
2003-08-27 08:59:58 +00:00
|
|
|
XMLPUBFUN void XMLCALL
|
|
|
|
xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
|
2003-01-16 22:45:08 +00:00
|
|
|
xmlTextReaderErrorFunc *f,
|
|
|
|
void **arg);
|
|
|
|
|
2002-12-09 14:13:43 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* __XML_XMLREADER_H__ */
|
|
|
|
|