nokogiri 1.18.0-aarch64-linux-musl
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +39 -0
- data/LICENSE-DEPENDENCIES.md +2224 -0
- data/LICENSE.md +9 -0
- data/README.md +293 -0
- data/bin/nokogiri +131 -0
- data/dependencies.yml +42 -0
- data/ext/nokogiri/depend +38 -0
- data/ext/nokogiri/extconf.rb +1173 -0
- data/ext/nokogiri/gumbo.c +610 -0
- data/ext/nokogiri/html4_document.c +171 -0
- data/ext/nokogiri/html4_element_description.c +299 -0
- data/ext/nokogiri/html4_entity_lookup.c +37 -0
- data/ext/nokogiri/html4_sax_parser.c +40 -0
- data/ext/nokogiri/html4_sax_parser_context.c +98 -0
- data/ext/nokogiri/html4_sax_push_parser.c +96 -0
- data/ext/nokogiri/include/libexslt/exslt.h +108 -0
- data/ext/nokogiri/include/libexslt/exsltconfig.h +70 -0
- data/ext/nokogiri/include/libexslt/exsltexports.h +63 -0
- data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +336 -0
- data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +147 -0
- data/ext/nokogiri/include/libxml2/libxml/SAX.h +202 -0
- data/ext/nokogiri/include/libxml2/libxml/SAX2.h +171 -0
- data/ext/nokogiri/include/libxml2/libxml/c14n.h +115 -0
- data/ext/nokogiri/include/libxml2/libxml/catalog.h +182 -0
- data/ext/nokogiri/include/libxml2/libxml/chvalid.h +230 -0
- data/ext/nokogiri/include/libxml2/libxml/debugXML.h +217 -0
- data/ext/nokogiri/include/libxml2/libxml/dict.h +82 -0
- data/ext/nokogiri/include/libxml2/libxml/encoding.h +244 -0
- data/ext/nokogiri/include/libxml2/libxml/entities.h +166 -0
- data/ext/nokogiri/include/libxml2/libxml/globals.h +41 -0
- data/ext/nokogiri/include/libxml2/libxml/hash.h +251 -0
- data/ext/nokogiri/include/libxml2/libxml/list.h +137 -0
- data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +186 -0
- data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +98 -0
- data/ext/nokogiri/include/libxml2/libxml/parser.h +1390 -0
- data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +671 -0
- data/ext/nokogiri/include/libxml2/libxml/pattern.h +106 -0
- data/ext/nokogiri/include/libxml2/libxml/relaxng.h +219 -0
- data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +959 -0
- data/ext/nokogiri/include/libxml2/libxml/schematron.h +143 -0
- data/ext/nokogiri/include/libxml2/libxml/threads.h +87 -0
- data/ext/nokogiri/include/libxml2/libxml/tree.h +1382 -0
- data/ext/nokogiri/include/libxml2/libxml/uri.h +106 -0
- data/ext/nokogiri/include/libxml2/libxml/valid.h +477 -0
- data/ext/nokogiri/include/libxml2/libxml/xinclude.h +136 -0
- data/ext/nokogiri/include/libxml2/libxml/xlink.h +189 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +438 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +146 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +962 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +146 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +188 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +57 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +436 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +215 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +102 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +249 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +152 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +140 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +366 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +347 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +489 -0
- data/ext/nokogiri/include/libxml2/libxml/xpath.h +579 -0
- data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +633 -0
- data/ext/nokogiri/include/libxml2/libxml/xpointer.h +138 -0
- data/ext/nokogiri/include/libxslt/attributes.h +39 -0
- data/ext/nokogiri/include/libxslt/documents.h +93 -0
- data/ext/nokogiri/include/libxslt/extensions.h +262 -0
- data/ext/nokogiri/include/libxslt/extra.h +72 -0
- data/ext/nokogiri/include/libxslt/functions.h +78 -0
- data/ext/nokogiri/include/libxslt/imports.h +75 -0
- data/ext/nokogiri/include/libxslt/keys.h +53 -0
- data/ext/nokogiri/include/libxslt/namespaces.h +68 -0
- data/ext/nokogiri/include/libxslt/numbersInternals.h +73 -0
- data/ext/nokogiri/include/libxslt/pattern.h +84 -0
- data/ext/nokogiri/include/libxslt/preproc.h +43 -0
- data/ext/nokogiri/include/libxslt/security.h +104 -0
- data/ext/nokogiri/include/libxslt/templates.h +77 -0
- data/ext/nokogiri/include/libxslt/transform.h +207 -0
- data/ext/nokogiri/include/libxslt/variables.h +118 -0
- data/ext/nokogiri/include/libxslt/xslt.h +110 -0
- data/ext/nokogiri/include/libxslt/xsltInternals.h +1995 -0
- data/ext/nokogiri/include/libxslt/xsltconfig.h +146 -0
- data/ext/nokogiri/include/libxslt/xsltexports.h +64 -0
- data/ext/nokogiri/include/libxslt/xsltlocale.h +44 -0
- data/ext/nokogiri/include/libxslt/xsltutils.h +343 -0
- data/ext/nokogiri/libxml2_polyfill.c +114 -0
- data/ext/nokogiri/nokogiri.c +294 -0
- data/ext/nokogiri/nokogiri.h +238 -0
- data/ext/nokogiri/test_global_handlers.c +40 -0
- data/ext/nokogiri/xml_attr.c +103 -0
- data/ext/nokogiri/xml_attribute_decl.c +70 -0
- data/ext/nokogiri/xml_cdata.c +62 -0
- data/ext/nokogiri/xml_comment.c +57 -0
- data/ext/nokogiri/xml_document.c +784 -0
- data/ext/nokogiri/xml_document_fragment.c +29 -0
- data/ext/nokogiri/xml_dtd.c +208 -0
- data/ext/nokogiri/xml_element_content.c +131 -0
- data/ext/nokogiri/xml_element_decl.c +69 -0
- data/ext/nokogiri/xml_encoding_handler.c +112 -0
- data/ext/nokogiri/xml_entity_decl.c +112 -0
- data/ext/nokogiri/xml_entity_reference.c +50 -0
- data/ext/nokogiri/xml_namespace.c +181 -0
- data/ext/nokogiri/xml_node.c +2459 -0
- data/ext/nokogiri/xml_node_set.c +518 -0
- data/ext/nokogiri/xml_processing_instruction.c +54 -0
- data/ext/nokogiri/xml_reader.c +777 -0
- data/ext/nokogiri/xml_relax_ng.c +149 -0
- data/ext/nokogiri/xml_sax_parser.c +403 -0
- data/ext/nokogiri/xml_sax_parser_context.c +390 -0
- data/ext/nokogiri/xml_sax_push_parser.c +206 -0
- data/ext/nokogiri/xml_schema.c +226 -0
- data/ext/nokogiri/xml_syntax_error.c +93 -0
- data/ext/nokogiri/xml_text.c +59 -0
- data/ext/nokogiri/xml_xpath_context.c +486 -0
- data/ext/nokogiri/xslt_stylesheet.c +421 -0
- data/gumbo-parser/CHANGES.md +63 -0
- data/gumbo-parser/Makefile +129 -0
- data/gumbo-parser/THANKS +27 -0
- data/lib/nokogiri/3.1/nokogiri.so +0 -0
- data/lib/nokogiri/3.2/nokogiri.so +0 -0
- data/lib/nokogiri/3.3/nokogiri.so +0 -0
- data/lib/nokogiri/3.4/nokogiri.so +0 -0
- data/lib/nokogiri/class_resolver.rb +67 -0
- data/lib/nokogiri/css/node.rb +58 -0
- data/lib/nokogiri/css/parser.rb +772 -0
- data/lib/nokogiri/css/parser.y +277 -0
- data/lib/nokogiri/css/parser_extras.rb +36 -0
- data/lib/nokogiri/css/selector_cache.rb +38 -0
- data/lib/nokogiri/css/syntax_error.rb +9 -0
- data/lib/nokogiri/css/tokenizer.rb +155 -0
- data/lib/nokogiri/css/tokenizer.rex +57 -0
- data/lib/nokogiri/css/xpath_visitor.rb +375 -0
- data/lib/nokogiri/css.rb +132 -0
- data/lib/nokogiri/decorators/slop.rb +42 -0
- data/lib/nokogiri/encoding_handler.rb +57 -0
- data/lib/nokogiri/extension.rb +32 -0
- data/lib/nokogiri/gumbo.rb +15 -0
- data/lib/nokogiri/html.rb +48 -0
- data/lib/nokogiri/html4/builder.rb +37 -0
- data/lib/nokogiri/html4/document.rb +235 -0
- data/lib/nokogiri/html4/document_fragment.rb +166 -0
- data/lib/nokogiri/html4/element_description.rb +25 -0
- data/lib/nokogiri/html4/element_description_defaults.rb +2040 -0
- data/lib/nokogiri/html4/encoding_reader.rb +121 -0
- data/lib/nokogiri/html4/entity_lookup.rb +15 -0
- data/lib/nokogiri/html4/sax/parser.rb +48 -0
- data/lib/nokogiri/html4/sax/parser_context.rb +15 -0
- data/lib/nokogiri/html4/sax/push_parser.rb +37 -0
- data/lib/nokogiri/html4.rb +42 -0
- data/lib/nokogiri/html5/builder.rb +40 -0
- data/lib/nokogiri/html5/document.rb +199 -0
- data/lib/nokogiri/html5/document_fragment.rb +200 -0
- data/lib/nokogiri/html5/node.rb +103 -0
- data/lib/nokogiri/html5.rb +368 -0
- data/lib/nokogiri/jruby/dependencies.rb +3 -0
- data/lib/nokogiri/jruby/nokogiri_jars.rb +43 -0
- data/lib/nokogiri/syntax_error.rb +6 -0
- data/lib/nokogiri/version/constant.rb +6 -0
- data/lib/nokogiri/version/info.rb +224 -0
- data/lib/nokogiri/version.rb +4 -0
- data/lib/nokogiri/xml/attr.rb +66 -0
- data/lib/nokogiri/xml/attribute_decl.rb +22 -0
- data/lib/nokogiri/xml/builder.rb +494 -0
- data/lib/nokogiri/xml/cdata.rb +13 -0
- data/lib/nokogiri/xml/character_data.rb +9 -0
- data/lib/nokogiri/xml/document.rb +514 -0
- data/lib/nokogiri/xml/document_fragment.rb +276 -0
- data/lib/nokogiri/xml/dtd.rb +34 -0
- data/lib/nokogiri/xml/element_content.rb +46 -0
- data/lib/nokogiri/xml/element_decl.rb +17 -0
- data/lib/nokogiri/xml/entity_decl.rb +23 -0
- data/lib/nokogiri/xml/entity_reference.rb +20 -0
- data/lib/nokogiri/xml/namespace.rb +57 -0
- data/lib/nokogiri/xml/node/save_options.rb +76 -0
- data/lib/nokogiri/xml/node.rb +1650 -0
- data/lib/nokogiri/xml/node_set.rb +449 -0
- data/lib/nokogiri/xml/notation.rb +19 -0
- data/lib/nokogiri/xml/parse_options.rb +213 -0
- data/lib/nokogiri/xml/pp/character_data.rb +21 -0
- data/lib/nokogiri/xml/pp/node.rb +73 -0
- data/lib/nokogiri/xml/pp.rb +4 -0
- data/lib/nokogiri/xml/processing_instruction.rb +11 -0
- data/lib/nokogiri/xml/reader.rb +139 -0
- data/lib/nokogiri/xml/relax_ng.rb +75 -0
- data/lib/nokogiri/xml/sax/document.rb +258 -0
- data/lib/nokogiri/xml/sax/parser.rb +199 -0
- data/lib/nokogiri/xml/sax/parser_context.rb +129 -0
- data/lib/nokogiri/xml/sax/push_parser.rb +64 -0
- data/lib/nokogiri/xml/sax.rb +54 -0
- data/lib/nokogiri/xml/schema.rb +140 -0
- data/lib/nokogiri/xml/searchable.rb +274 -0
- data/lib/nokogiri/xml/syntax_error.rb +94 -0
- data/lib/nokogiri/xml/text.rb +11 -0
- data/lib/nokogiri/xml/xpath/syntax_error.rb +13 -0
- data/lib/nokogiri/xml/xpath.rb +21 -0
- data/lib/nokogiri/xml/xpath_context.rb +27 -0
- data/lib/nokogiri/xml.rb +65 -0
- data/lib/nokogiri/xslt/stylesheet.rb +49 -0
- data/lib/nokogiri/xslt.rb +129 -0
- data/lib/nokogiri.rb +128 -0
- data/lib/xsd/xmlparser/nokogiri.rb +105 -0
- metadata +321 -0
@@ -0,0 +1,436 @@
|
|
1
|
+
/*
|
2
|
+
* Summary: the XMLReader implementation
|
3
|
+
* Description: API of the XML streaming API based on C# interfaces.
|
4
|
+
*
|
5
|
+
* Copy: See Copyright for the status of this software.
|
6
|
+
*
|
7
|
+
* Author: Daniel Veillard
|
8
|
+
*/
|
9
|
+
|
10
|
+
#ifndef __XML_XMLREADER_H__
|
11
|
+
#define __XML_XMLREADER_H__
|
12
|
+
|
13
|
+
#include <libxml/xmlversion.h>
|
14
|
+
#include <libxml/tree.h>
|
15
|
+
#include <libxml/xmlerror.h>
|
16
|
+
#include <libxml/xmlIO.h>
|
17
|
+
#ifdef LIBXML_SCHEMAS_ENABLED
|
18
|
+
#include <libxml/relaxng.h>
|
19
|
+
#include <libxml/xmlschemas.h>
|
20
|
+
#endif
|
21
|
+
/* for compatibility */
|
22
|
+
#include <libxml/parser.h>
|
23
|
+
|
24
|
+
#ifdef __cplusplus
|
25
|
+
extern "C" {
|
26
|
+
#endif
|
27
|
+
|
28
|
+
/**
|
29
|
+
* xmlParserSeverities:
|
30
|
+
*
|
31
|
+
* How severe an error callback is when the per-reader error callback API
|
32
|
+
* is used.
|
33
|
+
*/
|
34
|
+
typedef enum {
|
35
|
+
XML_PARSER_SEVERITY_VALIDITY_WARNING = 1,
|
36
|
+
XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
|
37
|
+
XML_PARSER_SEVERITY_WARNING = 3,
|
38
|
+
XML_PARSER_SEVERITY_ERROR = 4
|
39
|
+
} xmlParserSeverities;
|
40
|
+
|
41
|
+
#ifdef LIBXML_READER_ENABLED
|
42
|
+
|
43
|
+
/**
|
44
|
+
* xmlTextReaderMode:
|
45
|
+
*
|
46
|
+
* Internal state values for the reader.
|
47
|
+
*/
|
48
|
+
typedef enum {
|
49
|
+
XML_TEXTREADER_MODE_INITIAL = 0,
|
50
|
+
XML_TEXTREADER_MODE_INTERACTIVE = 1,
|
51
|
+
XML_TEXTREADER_MODE_ERROR = 2,
|
52
|
+
XML_TEXTREADER_MODE_EOF =3,
|
53
|
+
XML_TEXTREADER_MODE_CLOSED = 4,
|
54
|
+
XML_TEXTREADER_MODE_READING = 5
|
55
|
+
} xmlTextReaderMode;
|
56
|
+
|
57
|
+
/**
|
58
|
+
* xmlParserProperties:
|
59
|
+
*
|
60
|
+
* Some common options to use with xmlTextReaderSetParserProp, but it
|
61
|
+
* is better to use xmlParserOption and the xmlReaderNewxxx and
|
62
|
+
* xmlReaderForxxx APIs now.
|
63
|
+
*/
|
64
|
+
typedef enum {
|
65
|
+
XML_PARSER_LOADDTD = 1,
|
66
|
+
XML_PARSER_DEFAULTATTRS = 2,
|
67
|
+
XML_PARSER_VALIDATE = 3,
|
68
|
+
XML_PARSER_SUBST_ENTITIES = 4
|
69
|
+
} xmlParserProperties;
|
70
|
+
|
71
|
+
/**
|
72
|
+
* xmlReaderTypes:
|
73
|
+
*
|
74
|
+
* Predefined constants for the different types of nodes.
|
75
|
+
*/
|
76
|
+
typedef enum {
|
77
|
+
XML_READER_TYPE_NONE = 0,
|
78
|
+
XML_READER_TYPE_ELEMENT = 1,
|
79
|
+
XML_READER_TYPE_ATTRIBUTE = 2,
|
80
|
+
XML_READER_TYPE_TEXT = 3,
|
81
|
+
XML_READER_TYPE_CDATA = 4,
|
82
|
+
XML_READER_TYPE_ENTITY_REFERENCE = 5,
|
83
|
+
XML_READER_TYPE_ENTITY = 6,
|
84
|
+
XML_READER_TYPE_PROCESSING_INSTRUCTION = 7,
|
85
|
+
XML_READER_TYPE_COMMENT = 8,
|
86
|
+
XML_READER_TYPE_DOCUMENT = 9,
|
87
|
+
XML_READER_TYPE_DOCUMENT_TYPE = 10,
|
88
|
+
XML_READER_TYPE_DOCUMENT_FRAGMENT = 11,
|
89
|
+
XML_READER_TYPE_NOTATION = 12,
|
90
|
+
XML_READER_TYPE_WHITESPACE = 13,
|
91
|
+
XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14,
|
92
|
+
XML_READER_TYPE_END_ELEMENT = 15,
|
93
|
+
XML_READER_TYPE_END_ENTITY = 16,
|
94
|
+
XML_READER_TYPE_XML_DECLARATION = 17
|
95
|
+
} xmlReaderTypes;
|
96
|
+
|
97
|
+
/**
|
98
|
+
* xmlTextReader:
|
99
|
+
*
|
100
|
+
* Structure for an xmlReader context.
|
101
|
+
*/
|
102
|
+
typedef struct _xmlTextReader xmlTextReader;
|
103
|
+
|
104
|
+
/**
|
105
|
+
* xmlTextReaderPtr:
|
106
|
+
*
|
107
|
+
* Pointer to an xmlReader context.
|
108
|
+
*/
|
109
|
+
typedef xmlTextReader *xmlTextReaderPtr;
|
110
|
+
|
111
|
+
/*
|
112
|
+
* Constructors & Destructor
|
113
|
+
*/
|
114
|
+
XMLPUBFUN xmlTextReaderPtr
|
115
|
+
xmlNewTextReader (xmlParserInputBufferPtr input,
|
116
|
+
const char *URI);
|
117
|
+
XMLPUBFUN xmlTextReaderPtr
|
118
|
+
xmlNewTextReaderFilename(const char *URI);
|
119
|
+
|
120
|
+
XMLPUBFUN void
|
121
|
+
xmlFreeTextReader (xmlTextReaderPtr reader);
|
122
|
+
|
123
|
+
XMLPUBFUN int
|
124
|
+
xmlTextReaderSetup(xmlTextReaderPtr reader,
|
125
|
+
xmlParserInputBufferPtr input, const char *URL,
|
126
|
+
const char *encoding, int options);
|
127
|
+
XMLPUBFUN void
|
128
|
+
xmlTextReaderSetMaxAmplification(xmlTextReaderPtr reader,
|
129
|
+
unsigned maxAmpl);
|
130
|
+
XMLPUBFUN const xmlError *
|
131
|
+
xmlTextReaderGetLastError(xmlTextReaderPtr reader);
|
132
|
+
|
133
|
+
/*
|
134
|
+
* Iterators
|
135
|
+
*/
|
136
|
+
XMLPUBFUN int
|
137
|
+
xmlTextReaderRead (xmlTextReaderPtr reader);
|
138
|
+
|
139
|
+
#ifdef LIBXML_WRITER_ENABLED
|
140
|
+
XMLPUBFUN xmlChar *
|
141
|
+
xmlTextReaderReadInnerXml(xmlTextReaderPtr reader);
|
142
|
+
|
143
|
+
XMLPUBFUN xmlChar *
|
144
|
+
xmlTextReaderReadOuterXml(xmlTextReaderPtr reader);
|
145
|
+
#endif
|
146
|
+
|
147
|
+
XMLPUBFUN xmlChar *
|
148
|
+
xmlTextReaderReadString (xmlTextReaderPtr reader);
|
149
|
+
XMLPUBFUN int
|
150
|
+
xmlTextReaderReadAttributeValue(xmlTextReaderPtr reader);
|
151
|
+
|
152
|
+
/*
|
153
|
+
* Attributes of the node
|
154
|
+
*/
|
155
|
+
XMLPUBFUN int
|
156
|
+
xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
|
157
|
+
XMLPUBFUN int
|
158
|
+
xmlTextReaderDepth (xmlTextReaderPtr reader);
|
159
|
+
XMLPUBFUN int
|
160
|
+
xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
|
161
|
+
XMLPUBFUN int
|
162
|
+
xmlTextReaderHasValue(xmlTextReaderPtr reader);
|
163
|
+
XMLPUBFUN int
|
164
|
+
xmlTextReaderIsDefault (xmlTextReaderPtr reader);
|
165
|
+
XMLPUBFUN int
|
166
|
+
xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
|
167
|
+
XMLPUBFUN int
|
168
|
+
xmlTextReaderNodeType (xmlTextReaderPtr reader);
|
169
|
+
XMLPUBFUN int
|
170
|
+
xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
|
171
|
+
XMLPUBFUN int
|
172
|
+
xmlTextReaderReadState (xmlTextReaderPtr reader);
|
173
|
+
XMLPUBFUN int
|
174
|
+
xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
|
175
|
+
|
176
|
+
XMLPUBFUN const xmlChar *
|
177
|
+
xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
|
178
|
+
XMLPUBFUN const xmlChar *
|
179
|
+
xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
|
180
|
+
XMLPUBFUN const xmlChar *
|
181
|
+
xmlTextReaderConstName (xmlTextReaderPtr reader);
|
182
|
+
XMLPUBFUN const xmlChar *
|
183
|
+
xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
|
184
|
+
XMLPUBFUN const xmlChar *
|
185
|
+
xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
|
186
|
+
XMLPUBFUN const xmlChar *
|
187
|
+
xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
|
188
|
+
XMLPUBFUN const xmlChar *
|
189
|
+
xmlTextReaderConstString (xmlTextReaderPtr reader,
|
190
|
+
const xmlChar *str);
|
191
|
+
XMLPUBFUN const xmlChar *
|
192
|
+
xmlTextReaderConstValue (xmlTextReaderPtr reader);
|
193
|
+
|
194
|
+
/*
|
195
|
+
* use the Const version of the routine for
|
196
|
+
* better performance and simpler code
|
197
|
+
*/
|
198
|
+
XMLPUBFUN xmlChar *
|
199
|
+
xmlTextReaderBaseUri (xmlTextReaderPtr reader);
|
200
|
+
XMLPUBFUN xmlChar *
|
201
|
+
xmlTextReaderLocalName (xmlTextReaderPtr reader);
|
202
|
+
XMLPUBFUN xmlChar *
|
203
|
+
xmlTextReaderName (xmlTextReaderPtr reader);
|
204
|
+
XMLPUBFUN xmlChar *
|
205
|
+
xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
|
206
|
+
XMLPUBFUN xmlChar *
|
207
|
+
xmlTextReaderPrefix (xmlTextReaderPtr reader);
|
208
|
+
XMLPUBFUN xmlChar *
|
209
|
+
xmlTextReaderXmlLang (xmlTextReaderPtr reader);
|
210
|
+
XMLPUBFUN xmlChar *
|
211
|
+
xmlTextReaderValue (xmlTextReaderPtr reader);
|
212
|
+
|
213
|
+
/*
|
214
|
+
* Methods of the XmlTextReader
|
215
|
+
*/
|
216
|
+
XMLPUBFUN int
|
217
|
+
xmlTextReaderClose (xmlTextReaderPtr reader);
|
218
|
+
XMLPUBFUN xmlChar *
|
219
|
+
xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
|
220
|
+
int no);
|
221
|
+
XMLPUBFUN xmlChar *
|
222
|
+
xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
|
223
|
+
const xmlChar *name);
|
224
|
+
XMLPUBFUN xmlChar *
|
225
|
+
xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
|
226
|
+
const xmlChar *localName,
|
227
|
+
const xmlChar *namespaceURI);
|
228
|
+
XMLPUBFUN xmlParserInputBufferPtr
|
229
|
+
xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
|
230
|
+
XMLPUBFUN xmlChar *
|
231
|
+
xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
|
232
|
+
const xmlChar *prefix);
|
233
|
+
XMLPUBFUN int
|
234
|
+
xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
|
235
|
+
int no);
|
236
|
+
XMLPUBFUN int
|
237
|
+
xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
|
238
|
+
const xmlChar *name);
|
239
|
+
XMLPUBFUN int
|
240
|
+
xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
|
241
|
+
const xmlChar *localName,
|
242
|
+
const xmlChar *namespaceURI);
|
243
|
+
XMLPUBFUN int
|
244
|
+
xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
|
245
|
+
XMLPUBFUN int
|
246
|
+
xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
|
247
|
+
XMLPUBFUN int
|
248
|
+
xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
|
249
|
+
XMLPUBFUN int
|
250
|
+
xmlTextReaderNormalization (xmlTextReaderPtr reader);
|
251
|
+
XMLPUBFUN const xmlChar *
|
252
|
+
xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
|
253
|
+
|
254
|
+
/*
|
255
|
+
* Extensions
|
256
|
+
*/
|
257
|
+
XMLPUBFUN int
|
258
|
+
xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
|
259
|
+
int prop,
|
260
|
+
int value);
|
261
|
+
XMLPUBFUN int
|
262
|
+
xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
|
263
|
+
int prop);
|
264
|
+
XMLPUBFUN xmlNodePtr
|
265
|
+
xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
|
266
|
+
|
267
|
+
XMLPUBFUN int
|
268
|
+
xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
|
269
|
+
|
270
|
+
XMLPUBFUN int
|
271
|
+
xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
|
272
|
+
|
273
|
+
XMLPUBFUN xmlNodePtr
|
274
|
+
xmlTextReaderPreserve (xmlTextReaderPtr reader);
|
275
|
+
#ifdef LIBXML_PATTERN_ENABLED
|
276
|
+
XMLPUBFUN int
|
277
|
+
xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
|
278
|
+
const xmlChar *pattern,
|
279
|
+
const xmlChar **namespaces);
|
280
|
+
#endif /* LIBXML_PATTERN_ENABLED */
|
281
|
+
XMLPUBFUN xmlDocPtr
|
282
|
+
xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
|
283
|
+
XMLPUBFUN xmlNodePtr
|
284
|
+
xmlTextReaderExpand (xmlTextReaderPtr reader);
|
285
|
+
XMLPUBFUN int
|
286
|
+
xmlTextReaderNext (xmlTextReaderPtr reader);
|
287
|
+
XMLPUBFUN int
|
288
|
+
xmlTextReaderNextSibling (xmlTextReaderPtr reader);
|
289
|
+
XMLPUBFUN int
|
290
|
+
xmlTextReaderIsValid (xmlTextReaderPtr reader);
|
291
|
+
#ifdef LIBXML_SCHEMAS_ENABLED
|
292
|
+
XMLPUBFUN int
|
293
|
+
xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
|
294
|
+
const char *rng);
|
295
|
+
XMLPUBFUN int
|
296
|
+
xmlTextReaderRelaxNGValidateCtxt(xmlTextReaderPtr reader,
|
297
|
+
xmlRelaxNGValidCtxtPtr ctxt,
|
298
|
+
int options);
|
299
|
+
|
300
|
+
XMLPUBFUN int
|
301
|
+
xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
|
302
|
+
xmlRelaxNGPtr schema);
|
303
|
+
XMLPUBFUN int
|
304
|
+
xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
|
305
|
+
const char *xsd);
|
306
|
+
XMLPUBFUN int
|
307
|
+
xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
|
308
|
+
xmlSchemaValidCtxtPtr ctxt,
|
309
|
+
int options);
|
310
|
+
XMLPUBFUN int
|
311
|
+
xmlTextReaderSetSchema (xmlTextReaderPtr reader,
|
312
|
+
xmlSchemaPtr schema);
|
313
|
+
#endif
|
314
|
+
XMLPUBFUN const xmlChar *
|
315
|
+
xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
|
316
|
+
XMLPUBFUN int
|
317
|
+
xmlTextReaderStandalone (xmlTextReaderPtr reader);
|
318
|
+
|
319
|
+
|
320
|
+
/*
|
321
|
+
* Index lookup
|
322
|
+
*/
|
323
|
+
XMLPUBFUN long
|
324
|
+
xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
|
325
|
+
|
326
|
+
/*
|
327
|
+
* New more complete APIs for simpler creation and reuse of readers
|
328
|
+
*/
|
329
|
+
XMLPUBFUN xmlTextReaderPtr
|
330
|
+
xmlReaderWalker (xmlDocPtr doc);
|
331
|
+
XMLPUBFUN xmlTextReaderPtr
|
332
|
+
xmlReaderForDoc (const xmlChar * cur,
|
333
|
+
const char *URL,
|
334
|
+
const char *encoding,
|
335
|
+
int options);
|
336
|
+
XMLPUBFUN xmlTextReaderPtr
|
337
|
+
xmlReaderForFile (const char *filename,
|
338
|
+
const char *encoding,
|
339
|
+
int options);
|
340
|
+
XMLPUBFUN xmlTextReaderPtr
|
341
|
+
xmlReaderForMemory (const char *buffer,
|
342
|
+
int size,
|
343
|
+
const char *URL,
|
344
|
+
const char *encoding,
|
345
|
+
int options);
|
346
|
+
XMLPUBFUN xmlTextReaderPtr
|
347
|
+
xmlReaderForFd (int fd,
|
348
|
+
const char *URL,
|
349
|
+
const char *encoding,
|
350
|
+
int options);
|
351
|
+
XMLPUBFUN xmlTextReaderPtr
|
352
|
+
xmlReaderForIO (xmlInputReadCallback ioread,
|
353
|
+
xmlInputCloseCallback ioclose,
|
354
|
+
void *ioctx,
|
355
|
+
const char *URL,
|
356
|
+
const char *encoding,
|
357
|
+
int options);
|
358
|
+
|
359
|
+
XMLPUBFUN int
|
360
|
+
xmlReaderNewWalker (xmlTextReaderPtr reader,
|
361
|
+
xmlDocPtr doc);
|
362
|
+
XMLPUBFUN int
|
363
|
+
xmlReaderNewDoc (xmlTextReaderPtr reader,
|
364
|
+
const xmlChar * cur,
|
365
|
+
const char *URL,
|
366
|
+
const char *encoding,
|
367
|
+
int options);
|
368
|
+
XMLPUBFUN int
|
369
|
+
xmlReaderNewFile (xmlTextReaderPtr reader,
|
370
|
+
const char *filename,
|
371
|
+
const char *encoding,
|
372
|
+
int options);
|
373
|
+
XMLPUBFUN int
|
374
|
+
xmlReaderNewMemory (xmlTextReaderPtr reader,
|
375
|
+
const char *buffer,
|
376
|
+
int size,
|
377
|
+
const char *URL,
|
378
|
+
const char *encoding,
|
379
|
+
int options);
|
380
|
+
XMLPUBFUN int
|
381
|
+
xmlReaderNewFd (xmlTextReaderPtr reader,
|
382
|
+
int fd,
|
383
|
+
const char *URL,
|
384
|
+
const char *encoding,
|
385
|
+
int options);
|
386
|
+
XMLPUBFUN int
|
387
|
+
xmlReaderNewIO (xmlTextReaderPtr reader,
|
388
|
+
xmlInputReadCallback ioread,
|
389
|
+
xmlInputCloseCallback ioclose,
|
390
|
+
void *ioctx,
|
391
|
+
const char *URL,
|
392
|
+
const char *encoding,
|
393
|
+
int options);
|
394
|
+
/*
|
395
|
+
* Error handling extensions
|
396
|
+
*/
|
397
|
+
typedef void * xmlTextReaderLocatorPtr;
|
398
|
+
|
399
|
+
/**
|
400
|
+
* xmlTextReaderErrorFunc:
|
401
|
+
* @arg: the user argument
|
402
|
+
* @msg: the message
|
403
|
+
* @severity: the severity of the error
|
404
|
+
* @locator: a locator indicating where the error occurred
|
405
|
+
*
|
406
|
+
* Signature of an error callback from a reader parser
|
407
|
+
*/
|
408
|
+
typedef void (*xmlTextReaderErrorFunc)(void *arg,
|
409
|
+
const char *msg,
|
410
|
+
xmlParserSeverities severity,
|
411
|
+
xmlTextReaderLocatorPtr locator);
|
412
|
+
XMLPUBFUN int
|
413
|
+
xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
|
414
|
+
XMLPUBFUN xmlChar *
|
415
|
+
xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
|
416
|
+
XMLPUBFUN void
|
417
|
+
xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
|
418
|
+
xmlTextReaderErrorFunc f,
|
419
|
+
void *arg);
|
420
|
+
XMLPUBFUN void
|
421
|
+
xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
|
422
|
+
xmlStructuredErrorFunc f,
|
423
|
+
void *arg);
|
424
|
+
XMLPUBFUN void
|
425
|
+
xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
|
426
|
+
xmlTextReaderErrorFunc *f,
|
427
|
+
void **arg);
|
428
|
+
|
429
|
+
#endif /* LIBXML_READER_ENABLED */
|
430
|
+
|
431
|
+
#ifdef __cplusplus
|
432
|
+
}
|
433
|
+
#endif
|
434
|
+
|
435
|
+
#endif /* __XML_XMLREADER_H__ */
|
436
|
+
|
@@ -0,0 +1,215 @@
|
|
1
|
+
/*
|
2
|
+
* Summary: regular expressions handling
|
3
|
+
* Description: basic API for libxml regular expressions handling used
|
4
|
+
* for XML Schemas and validation.
|
5
|
+
*
|
6
|
+
* Copy: See Copyright for the status of this software.
|
7
|
+
*
|
8
|
+
* Author: Daniel Veillard
|
9
|
+
*/
|
10
|
+
|
11
|
+
#ifndef __XML_REGEXP_H__
|
12
|
+
#define __XML_REGEXP_H__
|
13
|
+
|
14
|
+
#include <stdio.h>
|
15
|
+
#include <libxml/xmlversion.h>
|
16
|
+
#include <libxml/xmlstring.h>
|
17
|
+
|
18
|
+
#ifdef LIBXML_REGEXP_ENABLED
|
19
|
+
|
20
|
+
#ifdef __cplusplus
|
21
|
+
extern "C" {
|
22
|
+
#endif
|
23
|
+
|
24
|
+
/**
|
25
|
+
* xmlRegexpPtr:
|
26
|
+
*
|
27
|
+
* A libxml regular expression, they can actually be far more complex
|
28
|
+
* thank the POSIX regex expressions.
|
29
|
+
*/
|
30
|
+
typedef struct _xmlRegexp xmlRegexp;
|
31
|
+
typedef xmlRegexp *xmlRegexpPtr;
|
32
|
+
|
33
|
+
/**
|
34
|
+
* xmlRegExecCtxtPtr:
|
35
|
+
*
|
36
|
+
* A libxml progressive regular expression evaluation context
|
37
|
+
*/
|
38
|
+
typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
|
39
|
+
typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
|
40
|
+
|
41
|
+
/*
|
42
|
+
* The POSIX like API
|
43
|
+
*/
|
44
|
+
XMLPUBFUN xmlRegexpPtr
|
45
|
+
xmlRegexpCompile (const xmlChar *regexp);
|
46
|
+
XMLPUBFUN void xmlRegFreeRegexp(xmlRegexpPtr regexp);
|
47
|
+
XMLPUBFUN int
|
48
|
+
xmlRegexpExec (xmlRegexpPtr comp,
|
49
|
+
const xmlChar *value);
|
50
|
+
XMLPUBFUN void
|
51
|
+
xmlRegexpPrint (FILE *output,
|
52
|
+
xmlRegexpPtr regexp);
|
53
|
+
XMLPUBFUN int
|
54
|
+
xmlRegexpIsDeterminist(xmlRegexpPtr comp);
|
55
|
+
|
56
|
+
/**
|
57
|
+
* xmlRegExecCallbacks:
|
58
|
+
* @exec: the regular expression context
|
59
|
+
* @token: the current token string
|
60
|
+
* @transdata: transition data
|
61
|
+
* @inputdata: input data
|
62
|
+
*
|
63
|
+
* Callback function when doing a transition in the automata
|
64
|
+
*/
|
65
|
+
typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
|
66
|
+
const xmlChar *token,
|
67
|
+
void *transdata,
|
68
|
+
void *inputdata);
|
69
|
+
|
70
|
+
/*
|
71
|
+
* The progressive API
|
72
|
+
*/
|
73
|
+
XMLPUBFUN xmlRegExecCtxtPtr
|
74
|
+
xmlRegNewExecCtxt (xmlRegexpPtr comp,
|
75
|
+
xmlRegExecCallbacks callback,
|
76
|
+
void *data);
|
77
|
+
XMLPUBFUN void
|
78
|
+
xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
|
79
|
+
XMLPUBFUN int
|
80
|
+
xmlRegExecPushString(xmlRegExecCtxtPtr exec,
|
81
|
+
const xmlChar *value,
|
82
|
+
void *data);
|
83
|
+
XMLPUBFUN int
|
84
|
+
xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
|
85
|
+
const xmlChar *value,
|
86
|
+
const xmlChar *value2,
|
87
|
+
void *data);
|
88
|
+
|
89
|
+
XMLPUBFUN int
|
90
|
+
xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
|
91
|
+
int *nbval,
|
92
|
+
int *nbneg,
|
93
|
+
xmlChar **values,
|
94
|
+
int *terminal);
|
95
|
+
XMLPUBFUN int
|
96
|
+
xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
|
97
|
+
const xmlChar **string,
|
98
|
+
int *nbval,
|
99
|
+
int *nbneg,
|
100
|
+
xmlChar **values,
|
101
|
+
int *terminal);
|
102
|
+
#ifdef LIBXML_EXPR_ENABLED
|
103
|
+
/*
|
104
|
+
* Formal regular expression handling
|
105
|
+
* Its goal is to do some formal work on content models
|
106
|
+
*/
|
107
|
+
|
108
|
+
/* expressions are used within a context */
|
109
|
+
typedef struct _xmlExpCtxt xmlExpCtxt;
|
110
|
+
typedef xmlExpCtxt *xmlExpCtxtPtr;
|
111
|
+
|
112
|
+
XMLPUBFUN void
|
113
|
+
xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
|
114
|
+
XMLPUBFUN xmlExpCtxtPtr
|
115
|
+
xmlExpNewCtxt (int maxNodes,
|
116
|
+
xmlDictPtr dict);
|
117
|
+
|
118
|
+
XMLPUBFUN int
|
119
|
+
xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
|
120
|
+
XMLPUBFUN int
|
121
|
+
xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
|
122
|
+
|
123
|
+
/* Expressions are trees but the tree is opaque */
|
124
|
+
typedef struct _xmlExpNode xmlExpNode;
|
125
|
+
typedef xmlExpNode *xmlExpNodePtr;
|
126
|
+
|
127
|
+
typedef enum {
|
128
|
+
XML_EXP_EMPTY = 0,
|
129
|
+
XML_EXP_FORBID = 1,
|
130
|
+
XML_EXP_ATOM = 2,
|
131
|
+
XML_EXP_SEQ = 3,
|
132
|
+
XML_EXP_OR = 4,
|
133
|
+
XML_EXP_COUNT = 5
|
134
|
+
} xmlExpNodeType;
|
135
|
+
|
136
|
+
/*
|
137
|
+
* 2 core expressions shared by all for the empty language set
|
138
|
+
* and for the set with just the empty token
|
139
|
+
*/
|
140
|
+
XMLPUBVAR xmlExpNodePtr forbiddenExp;
|
141
|
+
XMLPUBVAR xmlExpNodePtr emptyExp;
|
142
|
+
|
143
|
+
/*
|
144
|
+
* Expressions are reference counted internally
|
145
|
+
*/
|
146
|
+
XMLPUBFUN void
|
147
|
+
xmlExpFree (xmlExpCtxtPtr ctxt,
|
148
|
+
xmlExpNodePtr expr);
|
149
|
+
XMLPUBFUN void
|
150
|
+
xmlExpRef (xmlExpNodePtr expr);
|
151
|
+
|
152
|
+
/*
|
153
|
+
* constructors can be either manual or from a string
|
154
|
+
*/
|
155
|
+
XMLPUBFUN xmlExpNodePtr
|
156
|
+
xmlExpParse (xmlExpCtxtPtr ctxt,
|
157
|
+
const char *expr);
|
158
|
+
XMLPUBFUN xmlExpNodePtr
|
159
|
+
xmlExpNewAtom (xmlExpCtxtPtr ctxt,
|
160
|
+
const xmlChar *name,
|
161
|
+
int len);
|
162
|
+
XMLPUBFUN xmlExpNodePtr
|
163
|
+
xmlExpNewOr (xmlExpCtxtPtr ctxt,
|
164
|
+
xmlExpNodePtr left,
|
165
|
+
xmlExpNodePtr right);
|
166
|
+
XMLPUBFUN xmlExpNodePtr
|
167
|
+
xmlExpNewSeq (xmlExpCtxtPtr ctxt,
|
168
|
+
xmlExpNodePtr left,
|
169
|
+
xmlExpNodePtr right);
|
170
|
+
XMLPUBFUN xmlExpNodePtr
|
171
|
+
xmlExpNewRange (xmlExpCtxtPtr ctxt,
|
172
|
+
xmlExpNodePtr subset,
|
173
|
+
int min,
|
174
|
+
int max);
|
175
|
+
/*
|
176
|
+
* The really interesting APIs
|
177
|
+
*/
|
178
|
+
XMLPUBFUN int
|
179
|
+
xmlExpIsNillable(xmlExpNodePtr expr);
|
180
|
+
XMLPUBFUN int
|
181
|
+
xmlExpMaxToken (xmlExpNodePtr expr);
|
182
|
+
XMLPUBFUN int
|
183
|
+
xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
|
184
|
+
xmlExpNodePtr expr,
|
185
|
+
const xmlChar**langList,
|
186
|
+
int len);
|
187
|
+
XMLPUBFUN int
|
188
|
+
xmlExpGetStart (xmlExpCtxtPtr ctxt,
|
189
|
+
xmlExpNodePtr expr,
|
190
|
+
const xmlChar**tokList,
|
191
|
+
int len);
|
192
|
+
XMLPUBFUN xmlExpNodePtr
|
193
|
+
xmlExpStringDerive(xmlExpCtxtPtr ctxt,
|
194
|
+
xmlExpNodePtr expr,
|
195
|
+
const xmlChar *str,
|
196
|
+
int len);
|
197
|
+
XMLPUBFUN xmlExpNodePtr
|
198
|
+
xmlExpExpDerive (xmlExpCtxtPtr ctxt,
|
199
|
+
xmlExpNodePtr expr,
|
200
|
+
xmlExpNodePtr sub);
|
201
|
+
XMLPUBFUN int
|
202
|
+
xmlExpSubsume (xmlExpCtxtPtr ctxt,
|
203
|
+
xmlExpNodePtr expr,
|
204
|
+
xmlExpNodePtr sub);
|
205
|
+
XMLPUBFUN void
|
206
|
+
xmlExpDump (xmlBufferPtr buf,
|
207
|
+
xmlExpNodePtr expr);
|
208
|
+
#endif /* LIBXML_EXPR_ENABLED */
|
209
|
+
#ifdef __cplusplus
|
210
|
+
}
|
211
|
+
#endif
|
212
|
+
|
213
|
+
#endif /* LIBXML_REGEXP_ENABLED */
|
214
|
+
|
215
|
+
#endif /*__XML_REGEXP_H__ */
|