/*
* Summary: the core parser module
* Description: Interfaces, constants and types related to the XML parser
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_PARSER_H__
#define __XML_PARSER_H__
#include <stdarg.h>
#include <libxml/xmlversion.h>
#include <libxml/tree.h>
#include <libxml/dict.h>
#include <libxml/hash.h>
#include <libxml/valid.h>
#include <libxml/entities.h>
#include <libxml/xmlerror.h>
#include <libxml/xmlstring.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* XML_DEFAULT_VERSION:
*
* The default version of XML used: 1.0
*/
#define XML_DEFAULT_VERSION "1.0"
/**
* xmlParserInput:
*
* An xmlParserInput is an input flow for the XML processor.
* Each entity parsed is associated an xmlParserInput (except the
* few predefined ones). This is the case both for internal entities
* - in which case the flow is already completely in memory - or
* external entities - in which case we use the buf structure for
* progressive reading and I18N conversions to the internal UTF-8 format.
*/
/**
* xmlParserInputDeallocate:
* @str: the string to deallocate
*
* Callback for freeing some parser input allocations.
*/
typedef void (* xmlParserInputDeallocate)(xmlChar *str);
struct _xmlParserInput {
/* Input buffer */
xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
const char *filename; /* The file analyzed, if any */
const char *directory; /* the directory/base of the file */
const xmlChar *base; /* Base of the array to parse */
const xmlChar *cur; /* Current char being parsed */
const xmlChar *end; /* end of the array to parse */
int length; /* length if known */
int line; /* Current line */
int col; /* Current column */
/*
* NOTE: consumed is only tested for equality in the parser code,
* so even if there is an overflow this should not give troubles
* for parsing very large instances.
*/
unsigned long consumed; /* How many xmlChars already consumed */
xmlParserInputDeallocate free; /* function to deallocate the base */
const xmlChar *encoding; /* the encoding string for entity */
const xmlChar *version; /* the version string for entity */
int standalone; /* Was that entity marked standalone */
int id; /* an unique identifier for the entity */
};
/**
* xmlParserNodeInfo:
*
* The parser can be asked to collect Node informations, i.e. at what
* place in the file they were detected.
* NOTE: This is off by default and not very well tested.
*/
typedef struct _xmlParserNodeInfo xmlParserNodeInfo;
typedef xmlParserNodeInfo *xmlParserNodeInfoPtr;
struct _xmlParserNodeInfo {
const struct _xmlNode* node;
/* Position & line # that text that created the node begins & ends on */
unsigned long begin_pos;
unsigned long begin_line;
unsigned long end_pos;
unsigned long end_line;
};
typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
struct _xmlParserNodeInfoSeq {
unsigned long maximum;
unsigned long length;
xmlParserNodeInfo* buffer;
};
/**
* xmlParserInputState:
*
* The parser is now working also as a state based parser.
* The recursive one use the state info for entities processing.
*/
typedef enum {
XML_PARSER_EOF = -1, /* nothing is to be parsed */
XML_PARSER_START = 0, /* nothing has been parsed */
XML_PARSER_MISC, /* Misc* before int subset */
XML_PARSER_PI, /* Within a processing instruction */
XML_PARSER_DTD, /* within some DTD content */
XML_PARSER_PROLOG, /* Misc* after internal subset */
XML_PARSER_COMMENT, /* within a comment */
XML_PARSER_START_TAG, /* within a start tag */
XML_PARSER_CONTENT, /* within the content */
XML_PARSER_CDATA_SECTION, /* within a CDATA section */
XML_PARSER_END_TAG, /* within a closing tag */
XML_PARSER_ENTITY_DECL, /* within an entity declaration */
XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */
XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */
XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */
XML_PARSER_EPILOG, /* the Misc* after the last end tag */
XML_PARSER_IGNORE, /* within an IGNORED section */
XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */
} xmlParserInputState;
/**
* XML_DETECT_IDS:
*
* Bit in the loadsubset context field to tell to do ID/REFs lookups.
* Use it to initialize xmlLoadExtDtdDefaultValue.
*/
#define XML_DETECT_IDS 2
/**
* XML_COMPLETE_ATTRS:
*
* Bit in the loadsubset context field to tell to do complete the
* elements attributes lists with the ones defaulted from the DTDs.
* Use it to initialize xmlLoadExtDtdDefaultValue.
*/
#define XML_COMPLETE_ATTRS 4
/**
* XML_SKIP_IDS:
*
* Bit in the loadsubset context field to tell to not do ID/REFs registration.
* Used to initialize xmlLoadExtDtdDefaultValue in some special cases.
*/
#define XML_SKIP_IDS 8
/**
* xmlParserMode:
*
* A parser can operate in various modes
*/
typedef enum {
XML_PARSE_UNKNOWN = 0,
XML_PARSE_DOM = 1,
XML_PARSE_SAX = 2,
XML_PARSE_PUSH_DOM = 3,
XML_PARSE_PUSH_SAX = 4,
XML_PARSE_READER = 5
} xmlParserMode;
/**
* xmlParserCtxt:
*
* The parser context.
* NOTE This doesn't completely define the parser state, the (current ?)
* design of the parser uses recursive function calls since this allow
* and easy mapping from the production rules of the specification
* to the actual code. The drawback is that the actual function call
* also reflect the parser state. However most of the parsing routines
* takes as the only argument the parser context pointer, so migrating
* to a state based parser for progressive parsing shouldn't be too hard.
*/
struct _xmlParserCtxt {
struct _xmlSAXHandler *sax; /* The SAX handler */
void *userData; /* For SAX interface only, used by DOM build */
xmlDocPtr myDoc; /* the document being built */
int wellFormed; /* is the document well formed */
int replaceEntities; /* shall we replace entities ? */
const xmlChar *version; /* the XML version string */
const xmlChar *encoding; /* the declared encoding, if any */
int standalone; /* standalone document */
int html; /* an HTML(1)/Docbook(2) document */
/* Input stream stack */
xmlParserInputPtr input; /* Current input stream */
int inputNr; /* Number of current input streams */
int inputMax; /* Max number of input streams */
xmlParserInputPtr *inputTab; /* stack of inputs */
/* Node analysis stack only used for DOM building */
xmlNodePtr node; /* Current parsed Node */
int nodeNr; /* Depth of the parsing stack */
int nodeMax; /* Max depth of the parsing stack */
xmlNodePtr *nodeTab; /* array of nodes */
int record_info; /* Whether node info should be kept */
xmlParserNodeInfoSeq node_seq; /* info about each node parsed */
int errNo; /* error code */
int hasExternalSubset; /* reference and external subset */
int hasPErefs; /* the internal subset has PE refs */
int external; /* are we parsing an external entity */
int valid; /* is the document valid */
int validate; /* shall we try to validate ? */
xmlValidCtxt vctxt; /* The validity context */
xmlParserInput
没有合适的资源?快使用搜索试试~ 我知道了~
VS2015编译的libxml2的64位库,版本是2.7.2
共52个文件
h:47个
lib:3个
exp:1个
需积分: 50 17 下载量 182 浏览量
2020-11-13
11:46:24
上传
评论 2
收藏 3.32MB ZIP 举报
温馨提示
VS2015编译的libxml2的64位库,版本是2.7.2。libxml2是一个用来解析XML文档的函数库。它用 C 语言写成,并且能被多种语言所调用,如 C、C++、XSH、C#、Python、Kylix、Delphi、Ruby、PHP 等。它最初是为 GNOME 开发的项目,但是现在可以用在各种各样的项目中。libxml2 的代码可移植性非常好,因为它基于标准的 ANSI C 库,并采用了 MIT 许可证。
资源推荐
资源详情
资源评论
收起资源包目录
libxml2-2.7.2.zip (52个子文件)
libxml2-2.7.2
x64
dll
libxml2.dll 1.22MB
include
libxml
xmlregexp.h 5KB
xmlschemas.h 6KB
xmlstring.h 5KB
xmlIO.h 10KB
xmlerror.h 36KB
xpath.h 16KB
xmlunicode.h 10KB
hash.h 6KB
entities.h 5KB
xmlexports.h 4KB
xmlversion.h 7KB
debugXML.h 5KB
dict.h 2KB
DOCBparser.h 3KB
threads.h 2KB
xmlwriter.h 20KB
parserInternals.h 16KB
catalog.h 5KB
uri.h 3KB
pattern.h 3KB
valid.h 13KB
HTMLparser.h 9KB
xmlschemastypes.h 5KB
encoding.h 8KB
tree.h 35KB
c14n.h 3KB
schematron.h 4KB
schemasInternals.h 25KB
xmlreader.h 12KB
relaxng.h 6KB
SAX.h 4KB
parser.h 38KB
chvalid.h 5KB
SAX2.h 5KB
list.h 3KB
xmlmemory.h 6KB
HTMLtree.h 4KB
xmlmodule.h 1KB
xmlsave.h 2KB
xinclude.h 3KB
xlink.h 5KB
xmlautomata.h 4KB
nanoftp.h 3KB
xpathInternals.h 19KB
xpointer.h 3KB
globals.h 14KB
nanohttp.h 2KB
lib
libxml2_a.lib 4.64MB
libxml2.lib 353KB
libxml2.exp 215KB
libxml2_a_dll.lib 4.64MB
共 52 条
- 1
资源评论
clever101
- 粉丝: 5866
- 资源: 159
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功