nokogiri 1.11.0.rc3-x86-linux → 1.11.3-x86-linux

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/LICENSE-DEPENDENCIES.md +1015 -947
  4. data/LICENSE.md +1 -1
  5. data/README.md +168 -91
  6. data/ext/nokogiri/depend +37 -358
  7. data/ext/nokogiri/extconf.rb +581 -374
  8. data/ext/nokogiri/html_document.c +78 -82
  9. data/ext/nokogiri/html_element_description.c +84 -71
  10. data/ext/nokogiri/html_entity_lookup.c +21 -16
  11. data/ext/nokogiri/html_sax_parser_context.c +69 -66
  12. data/ext/nokogiri/html_sax_push_parser.c +42 -34
  13. data/ext/nokogiri/include/libexslt/exslt.h +102 -0
  14. data/ext/nokogiri/include/libexslt/exsltconfig.h +70 -0
  15. data/ext/nokogiri/include/libexslt/exsltexports.h +140 -0
  16. data/ext/nokogiri/include/libxml2/libxml/DOCBparser.h +96 -0
  17. data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +306 -0
  18. data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +147 -0
  19. data/ext/nokogiri/include/libxml2/libxml/SAX.h +173 -0
  20. data/ext/nokogiri/include/libxml2/libxml/SAX2.h +178 -0
  21. data/ext/nokogiri/include/libxml2/libxml/c14n.h +126 -0
  22. data/ext/nokogiri/include/libxml2/libxml/catalog.h +182 -0
  23. data/ext/nokogiri/include/libxml2/libxml/chvalid.h +230 -0
  24. data/ext/nokogiri/include/libxml2/libxml/debugXML.h +217 -0
  25. data/ext/nokogiri/include/libxml2/libxml/dict.h +79 -0
  26. data/ext/nokogiri/include/libxml2/libxml/encoding.h +245 -0
  27. data/ext/nokogiri/include/libxml2/libxml/entities.h +151 -0
  28. data/ext/nokogiri/include/libxml2/libxml/globals.h +508 -0
  29. data/ext/nokogiri/include/libxml2/libxml/hash.h +236 -0
  30. data/ext/nokogiri/include/libxml2/libxml/list.h +137 -0
  31. data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +163 -0
  32. data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +81 -0
  33. data/ext/nokogiri/include/libxml2/libxml/parser.h +1241 -0
  34. data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +644 -0
  35. data/ext/nokogiri/include/libxml2/libxml/pattern.h +100 -0
  36. data/ext/nokogiri/include/libxml2/libxml/relaxng.h +217 -0
  37. data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +958 -0
  38. data/ext/nokogiri/include/libxml2/libxml/schematron.h +142 -0
  39. data/ext/nokogiri/include/libxml2/libxml/threads.h +89 -0
  40. data/ext/nokogiri/include/libxml2/libxml/tree.h +1311 -0
  41. data/ext/nokogiri/include/libxml2/libxml/uri.h +94 -0
  42. data/ext/nokogiri/include/libxml2/libxml/valid.h +458 -0
  43. data/ext/nokogiri/include/libxml2/libxml/xinclude.h +129 -0
  44. data/ext/nokogiri/include/libxml2/libxml/xlink.h +189 -0
  45. data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +366 -0
  46. data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +146 -0
  47. data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +945 -0
  48. data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +153 -0
  49. data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +224 -0
  50. data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +57 -0
  51. data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +428 -0
  52. data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +222 -0
  53. data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +88 -0
  54. data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +246 -0
  55. data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +151 -0
  56. data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +140 -0
  57. data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +202 -0
  58. data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +485 -0
  59. data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +488 -0
  60. data/ext/nokogiri/include/libxml2/libxml/xpath.h +566 -0
  61. data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +632 -0
  62. data/ext/nokogiri/include/libxml2/libxml/xpointer.h +114 -0
  63. data/ext/nokogiri/include/libxslt/attributes.h +38 -0
  64. data/ext/nokogiri/include/libxslt/documents.h +93 -0
  65. data/ext/nokogiri/include/libxslt/extensions.h +262 -0
  66. data/ext/nokogiri/include/libxslt/extra.h +72 -0
  67. data/ext/nokogiri/include/libxslt/functions.h +78 -0
  68. data/ext/nokogiri/include/libxslt/imports.h +75 -0
  69. data/ext/nokogiri/include/libxslt/keys.h +53 -0
  70. data/ext/nokogiri/include/libxslt/namespaces.h +68 -0
  71. data/ext/nokogiri/include/libxslt/numbersInternals.h +73 -0
  72. data/ext/nokogiri/include/libxslt/pattern.h +84 -0
  73. data/ext/nokogiri/include/libxslt/preproc.h +43 -0
  74. data/ext/nokogiri/include/libxslt/security.h +104 -0
  75. data/ext/nokogiri/include/libxslt/templates.h +77 -0
  76. data/ext/nokogiri/include/libxslt/transform.h +207 -0
  77. data/ext/nokogiri/include/libxslt/variables.h +118 -0
  78. data/ext/nokogiri/include/libxslt/xslt.h +110 -0
  79. data/ext/nokogiri/include/libxslt/xsltInternals.h +1978 -0
  80. data/ext/nokogiri/include/libxslt/xsltconfig.h +180 -0
  81. data/ext/nokogiri/include/libxslt/xsltexports.h +142 -0
  82. data/ext/nokogiri/include/libxslt/xsltlocale.h +76 -0
  83. data/ext/nokogiri/include/libxslt/xsltutils.h +313 -0
  84. data/ext/nokogiri/libxml2_backwards_compat.c +121 -0
  85. data/ext/nokogiri/nokogiri.c +192 -93
  86. data/ext/nokogiri/nokogiri.h +177 -98
  87. data/ext/nokogiri/test_global_handlers.c +40 -0
  88. data/ext/nokogiri/xml_attr.c +15 -15
  89. data/ext/nokogiri/xml_attribute_decl.c +18 -18
  90. data/ext/nokogiri/xml_cdata.c +13 -18
  91. data/ext/nokogiri/xml_comment.c +19 -26
  92. data/ext/nokogiri/xml_document.c +246 -188
  93. data/ext/nokogiri/xml_document_fragment.c +13 -15
  94. data/ext/nokogiri/xml_dtd.c +54 -48
  95. data/ext/nokogiri/xml_element_content.c +30 -27
  96. data/ext/nokogiri/xml_element_decl.c +22 -22
  97. data/ext/nokogiri/xml_encoding_handler.c +17 -11
  98. data/ext/nokogiri/xml_entity_decl.c +32 -30
  99. data/ext/nokogiri/xml_entity_reference.c +16 -18
  100. data/ext/nokogiri/xml_namespace.c +56 -49
  101. data/ext/nokogiri/xml_node.c +371 -320
  102. data/ext/nokogiri/xml_node_set.c +168 -156
  103. data/ext/nokogiri/xml_processing_instruction.c +17 -19
  104. data/ext/nokogiri/xml_reader.c +191 -157
  105. data/ext/nokogiri/xml_relax_ng.c +52 -28
  106. data/ext/nokogiri/xml_sax_parser.c +118 -118
  107. data/ext/nokogiri/xml_sax_parser_context.c +103 -86
  108. data/ext/nokogiri/xml_sax_push_parser.c +36 -27
  109. data/ext/nokogiri/xml_schema.c +95 -47
  110. data/ext/nokogiri/xml_syntax_error.c +42 -21
  111. data/ext/nokogiri/xml_text.c +13 -17
  112. data/ext/nokogiri/xml_xpath_context.c +206 -123
  113. data/ext/nokogiri/xslt_stylesheet.c +158 -161
  114. data/lib/nokogiri.rb +3 -7
  115. data/lib/nokogiri/2.5/nokogiri.so +0 -0
  116. data/lib/nokogiri/2.6/nokogiri.so +0 -0
  117. data/lib/nokogiri/2.7/nokogiri.so +0 -0
  118. data/lib/nokogiri/3.0/nokogiri.so +0 -0
  119. data/lib/nokogiri/css/parser.rb +3 -3
  120. data/lib/nokogiri/css/parser.y +2 -2
  121. data/lib/nokogiri/css/xpath_visitor.rb +70 -42
  122. data/lib/nokogiri/extension.rb +26 -0
  123. data/lib/nokogiri/html/document.rb +12 -26
  124. data/lib/nokogiri/html/document_fragment.rb +15 -15
  125. data/lib/nokogiri/version.rb +2 -149
  126. data/lib/nokogiri/version/constant.rb +5 -0
  127. data/lib/nokogiri/version/info.rb +205 -0
  128. data/lib/nokogiri/xml/document.rb +91 -35
  129. data/lib/nokogiri/xml/document_fragment.rb +4 -6
  130. data/lib/nokogiri/xml/node.rb +89 -69
  131. data/lib/nokogiri/xml/parse_options.rb +6 -0
  132. data/lib/nokogiri/xml/reader.rb +2 -9
  133. data/lib/nokogiri/xml/relax_ng.rb +6 -2
  134. data/lib/nokogiri/xml/schema.rb +12 -4
  135. data/lib/nokogiri/xml/searchable.rb +3 -1
  136. data/lib/nokogiri/xml/xpath.rb +1 -3
  137. data/lib/nokogiri/xml/xpath/syntax_error.rb +1 -1
  138. metadata +150 -171
  139. data/ext/nokogiri/html_document.h +0 -10
  140. data/ext/nokogiri/html_element_description.h +0 -10
  141. data/ext/nokogiri/html_entity_lookup.h +0 -8
  142. data/ext/nokogiri/html_sax_parser_context.h +0 -11
  143. data/ext/nokogiri/html_sax_push_parser.h +0 -9
  144. data/ext/nokogiri/xml_attr.h +0 -9
  145. data/ext/nokogiri/xml_attribute_decl.h +0 -9
  146. data/ext/nokogiri/xml_cdata.h +0 -9
  147. data/ext/nokogiri/xml_comment.h +0 -9
  148. data/ext/nokogiri/xml_document.h +0 -23
  149. data/ext/nokogiri/xml_document_fragment.h +0 -10
  150. data/ext/nokogiri/xml_dtd.h +0 -10
  151. data/ext/nokogiri/xml_element_content.h +0 -10
  152. data/ext/nokogiri/xml_element_decl.h +0 -9
  153. data/ext/nokogiri/xml_encoding_handler.h +0 -8
  154. data/ext/nokogiri/xml_entity_decl.h +0 -10
  155. data/ext/nokogiri/xml_entity_reference.h +0 -9
  156. data/ext/nokogiri/xml_io.c +0 -63
  157. data/ext/nokogiri/xml_io.h +0 -11
  158. data/ext/nokogiri/xml_libxml2_hacks.c +0 -112
  159. data/ext/nokogiri/xml_libxml2_hacks.h +0 -12
  160. data/ext/nokogiri/xml_namespace.h +0 -14
  161. data/ext/nokogiri/xml_node.h +0 -13
  162. data/ext/nokogiri/xml_node_set.h +0 -12
  163. data/ext/nokogiri/xml_processing_instruction.h +0 -9
  164. data/ext/nokogiri/xml_reader.h +0 -10
  165. data/ext/nokogiri/xml_relax_ng.h +0 -9
  166. data/ext/nokogiri/xml_sax_parser.h +0 -39
  167. data/ext/nokogiri/xml_sax_parser_context.h +0 -10
  168. data/ext/nokogiri/xml_sax_push_parser.h +0 -9
  169. data/ext/nokogiri/xml_schema.h +0 -9
  170. data/ext/nokogiri/xml_syntax_error.h +0 -13
  171. data/ext/nokogiri/xml_text.h +0 -9
  172. data/ext/nokogiri/xml_xpath_context.h +0 -10
  173. data/ext/nokogiri/xslt_stylesheet.h +0 -14
  174. data/lib/nokogiri/2.4/nokogiri.so +0 -0
@@ -0,0 +1,70 @@
1
+ /*
2
+ * exsltconfig.h: compile-time version information for the EXSLT library
3
+ *
4
+ * See Copyright for the status of this software.
5
+ *
6
+ * daniel@veillard.com
7
+ */
8
+
9
+ #ifndef __XML_EXSLTCONFIG_H__
10
+ #define __XML_EXSLTCONFIG_H__
11
+
12
+ #ifdef __cplusplus
13
+ extern "C" {
14
+ #endif
15
+
16
+ /**
17
+ * LIBEXSLT_DOTTED_VERSION:
18
+ *
19
+ * the version string like "1.2.3"
20
+ */
21
+ #define LIBEXSLT_DOTTED_VERSION "1.1.34"
22
+
23
+ /**
24
+ * LIBEXSLT_VERSION:
25
+ *
26
+ * the version number: 1.2.3 value is 10203
27
+ */
28
+ #define LIBEXSLT_VERSION 820
29
+
30
+ /**
31
+ * LIBEXSLT_VERSION_STRING:
32
+ *
33
+ * the version number string, 1.2.3 value is "10203"
34
+ */
35
+ #define LIBEXSLT_VERSION_STRING "820"
36
+
37
+ /**
38
+ * LIBEXSLT_VERSION_EXTRA:
39
+ *
40
+ * extra version information, used to show a CVS compilation
41
+ */
42
+ #define LIBEXSLT_VERSION_EXTRA ""
43
+
44
+ /**
45
+ * WITH_CRYPTO:
46
+ *
47
+ * Whether crypto support is configured into exslt
48
+ */
49
+ #if 0
50
+ #define EXSLT_CRYPTO_ENABLED
51
+ #endif
52
+
53
+ /**
54
+ * ATTRIBUTE_UNUSED:
55
+ *
56
+ * This macro is used to flag unused function parameters to GCC
57
+ */
58
+ #ifdef __GNUC__
59
+ #ifndef ATTRIBUTE_UNUSED
60
+ #define ATTRIBUTE_UNUSED __attribute__((unused))
61
+ #endif
62
+ #else
63
+ #define ATTRIBUTE_UNUSED
64
+ #endif
65
+
66
+ #ifdef __cplusplus
67
+ }
68
+ #endif
69
+
70
+ #endif /* __XML_EXSLTCONFIG_H__ */
@@ -0,0 +1,140 @@
1
+ /*
2
+ * exsltexports.h : macros for marking symbols as exportable/importable.
3
+ *
4
+ * See Copyright for the status of this software.
5
+ *
6
+ * igor@zlatkovic.com
7
+ */
8
+
9
+ #ifndef __EXSLT_EXPORTS_H__
10
+ #define __EXSLT_EXPORTS_H__
11
+
12
+ /**
13
+ * EXSLTPUBFUN, EXSLTPUBVAR, EXSLTCALL
14
+ *
15
+ * Macros which declare an exportable function, an exportable variable and
16
+ * the calling convention used for functions.
17
+ *
18
+ * Please use an extra block for every platform/compiler combination when
19
+ * modifying this, rather than overlong #ifdef lines. This helps
20
+ * readability as well as the fact that different compilers on the same
21
+ * platform might need different definitions.
22
+ */
23
+
24
+ /**
25
+ * EXSLTPUBFUN:
26
+ *
27
+ * Macros which declare an exportable function
28
+ */
29
+ #define EXSLTPUBFUN
30
+ /**
31
+ * EXSLTPUBVAR:
32
+ *
33
+ * Macros which declare an exportable variable
34
+ */
35
+ #define EXSLTPUBVAR extern
36
+ /**
37
+ * EXSLTCALL:
38
+ *
39
+ * Macros which declare the called convention for exported functions
40
+ */
41
+ #define EXSLTCALL
42
+
43
+ /** DOC_DISABLE */
44
+
45
+ /* Windows platform with MS compiler */
46
+ #if defined(_WIN32) && defined(_MSC_VER)
47
+ #undef EXSLTPUBFUN
48
+ #undef EXSLTPUBVAR
49
+ #undef EXSLTCALL
50
+ #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC)
51
+ #define EXSLTPUBFUN __declspec(dllexport)
52
+ #define EXSLTPUBVAR __declspec(dllexport)
53
+ #else
54
+ #define EXSLTPUBFUN
55
+ #if !defined(LIBEXSLT_STATIC)
56
+ #define EXSLTPUBVAR __declspec(dllimport) extern
57
+ #else
58
+ #define EXSLTPUBVAR extern
59
+ #endif
60
+ #endif
61
+ #define EXSLTCALL __cdecl
62
+ #if !defined _REENTRANT
63
+ #define _REENTRANT
64
+ #endif
65
+ #endif
66
+
67
+ /* Windows platform with Borland compiler */
68
+ #if defined(_WIN32) && defined(__BORLANDC__)
69
+ #undef EXSLTPUBFUN
70
+ #undef EXSLTPUBVAR
71
+ #undef EXSLTCALL
72
+ #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC)
73
+ #define EXSLTPUBFUN __declspec(dllexport)
74
+ #define EXSLTPUBVAR __declspec(dllexport) extern
75
+ #else
76
+ #define EXSLTPUBFUN
77
+ #if !defined(LIBEXSLT_STATIC)
78
+ #define EXSLTPUBVAR __declspec(dllimport) extern
79
+ #else
80
+ #define EXSLTPUBVAR extern
81
+ #endif
82
+ #endif
83
+ #define EXSLTCALL __cdecl
84
+ #if !defined _REENTRANT
85
+ #define _REENTRANT
86
+ #endif
87
+ #endif
88
+
89
+ /* Windows platform with GNU compiler (Mingw) */
90
+ #if defined(_WIN32) && defined(__MINGW32__)
91
+ #undef EXSLTPUBFUN
92
+ #undef EXSLTPUBVAR
93
+ #undef EXSLTCALL
94
+ /*
95
+ #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC)
96
+ */
97
+ #if !defined(LIBEXSLT_STATIC)
98
+ #define EXSLTPUBFUN __declspec(dllexport)
99
+ #define EXSLTPUBVAR __declspec(dllexport) extern
100
+ #else
101
+ #define EXSLTPUBFUN
102
+ #if !defined(LIBEXSLT_STATIC)
103
+ #define EXSLTPUBVAR __declspec(dllimport) extern
104
+ #else
105
+ #define EXSLTPUBVAR extern
106
+ #endif
107
+ #endif
108
+ #define EXSLTCALL __cdecl
109
+ #if !defined _REENTRANT
110
+ #define _REENTRANT
111
+ #endif
112
+ #endif
113
+
114
+ /* Cygwin platform (does not define _WIN32), GNU compiler */
115
+ #if defined(__CYGWIN__)
116
+ #undef EXSLTPUBFUN
117
+ #undef EXSLTPUBVAR
118
+ #undef EXSLTCALL
119
+ #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC)
120
+ #define EXSLTPUBFUN __declspec(dllexport)
121
+ #define EXSLTPUBVAR __declspec(dllexport)
122
+ #else
123
+ #define EXSLTPUBFUN
124
+ #if !defined(LIBEXSLT_STATIC)
125
+ #define EXSLTPUBVAR __declspec(dllimport) extern
126
+ #else
127
+ #define EXSLTPUBVAR extern
128
+ #endif
129
+ #endif
130
+ #define EXSLTCALL __cdecl
131
+ #endif
132
+
133
+ /* Compatibility */
134
+ #if !defined(LIBEXSLT_PUBLIC)
135
+ #define LIBEXSLT_PUBLIC EXSLTPUBVAR
136
+ #endif
137
+
138
+ #endif /* __EXSLT_EXPORTS_H__ */
139
+
140
+
@@ -0,0 +1,96 @@
1
+ /*
2
+ * Summary: old DocBook SGML parser
3
+ * Description: interface for a DocBook SGML non-verifying parser
4
+ * This code is DEPRECATED, and should not be used anymore.
5
+ *
6
+ * Copy: See Copyright for the status of this software.
7
+ *
8
+ * Author: Daniel Veillard
9
+ */
10
+
11
+ #ifndef __DOCB_PARSER_H__
12
+ #define __DOCB_PARSER_H__
13
+ #include <libxml/xmlversion.h>
14
+
15
+ #ifdef LIBXML_DOCB_ENABLED
16
+
17
+ #include <libxml/parser.h>
18
+ #include <libxml/parserInternals.h>
19
+
20
+ #ifndef IN_LIBXML
21
+ #ifdef __GNUC__
22
+ #warning "The DOCBparser module has been deprecated in libxml2-2.6.0"
23
+ #endif
24
+ #endif
25
+
26
+ #ifdef __cplusplus
27
+ extern "C" {
28
+ #endif
29
+
30
+ /*
31
+ * Most of the back-end structures from XML and SGML are shared.
32
+ */
33
+ typedef xmlParserCtxt docbParserCtxt;
34
+ typedef xmlParserCtxtPtr docbParserCtxtPtr;
35
+ typedef xmlSAXHandler docbSAXHandler;
36
+ typedef xmlSAXHandlerPtr docbSAXHandlerPtr;
37
+ typedef xmlParserInput docbParserInput;
38
+ typedef xmlParserInputPtr docbParserInputPtr;
39
+ typedef xmlDocPtr docbDocPtr;
40
+
41
+ /*
42
+ * There is only few public functions.
43
+ */
44
+ XMLPUBFUN int XMLCALL
45
+ docbEncodeEntities(unsigned char *out,
46
+ int *outlen,
47
+ const unsigned char *in,
48
+ int *inlen, int quoteChar);
49
+
50
+ XMLPUBFUN docbDocPtr XMLCALL
51
+ docbSAXParseDoc (xmlChar *cur,
52
+ const char *encoding,
53
+ docbSAXHandlerPtr sax,
54
+ void *userData);
55
+ XMLPUBFUN docbDocPtr XMLCALL
56
+ docbParseDoc (xmlChar *cur,
57
+ const char *encoding);
58
+ XMLPUBFUN docbDocPtr XMLCALL
59
+ docbSAXParseFile (const char *filename,
60
+ const char *encoding,
61
+ docbSAXHandlerPtr sax,
62
+ void *userData);
63
+ XMLPUBFUN docbDocPtr XMLCALL
64
+ docbParseFile (const char *filename,
65
+ const char *encoding);
66
+
67
+ /**
68
+ * Interfaces for the Push mode.
69
+ */
70
+ XMLPUBFUN void XMLCALL
71
+ docbFreeParserCtxt (docbParserCtxtPtr ctxt);
72
+ XMLPUBFUN docbParserCtxtPtr XMLCALL
73
+ docbCreatePushParserCtxt(docbSAXHandlerPtr sax,
74
+ void *user_data,
75
+ const char *chunk,
76
+ int size,
77
+ const char *filename,
78
+ xmlCharEncoding enc);
79
+ XMLPUBFUN int XMLCALL
80
+ docbParseChunk (docbParserCtxtPtr ctxt,
81
+ const char *chunk,
82
+ int size,
83
+ int terminate);
84
+ XMLPUBFUN docbParserCtxtPtr XMLCALL
85
+ docbCreateFileParserCtxt(const char *filename,
86
+ const char *encoding);
87
+ XMLPUBFUN int XMLCALL
88
+ docbParseDocument (docbParserCtxtPtr ctxt);
89
+
90
+ #ifdef __cplusplus
91
+ }
92
+ #endif
93
+
94
+ #endif /* LIBXML_DOCB_ENABLED */
95
+
96
+ #endif /* __DOCB_PARSER_H__ */
@@ -0,0 +1,306 @@
1
+ /*
2
+ * Summary: interface for an HTML 4.0 non-verifying parser
3
+ * Description: this module implements an HTML 4.0 non-verifying parser
4
+ * with API compatible with the XML parser ones. It should
5
+ * be able to parse "real world" HTML, even if severely
6
+ * broken from a specification point of view.
7
+ *
8
+ * Copy: See Copyright for the status of this software.
9
+ *
10
+ * Author: Daniel Veillard
11
+ */
12
+
13
+ #ifndef __HTML_PARSER_H__
14
+ #define __HTML_PARSER_H__
15
+ #include <libxml/xmlversion.h>
16
+ #include <libxml/parser.h>
17
+
18
+ #ifdef LIBXML_HTML_ENABLED
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+
24
+ /*
25
+ * Most of the back-end structures from XML and HTML are shared.
26
+ */
27
+ typedef xmlParserCtxt htmlParserCtxt;
28
+ typedef xmlParserCtxtPtr htmlParserCtxtPtr;
29
+ typedef xmlParserNodeInfo htmlParserNodeInfo;
30
+ typedef xmlSAXHandler htmlSAXHandler;
31
+ typedef xmlSAXHandlerPtr htmlSAXHandlerPtr;
32
+ typedef xmlParserInput htmlParserInput;
33
+ typedef xmlParserInputPtr htmlParserInputPtr;
34
+ typedef xmlDocPtr htmlDocPtr;
35
+ typedef xmlNodePtr htmlNodePtr;
36
+
37
+ /*
38
+ * Internal description of an HTML element, representing HTML 4.01
39
+ * and XHTML 1.0 (which share the same structure).
40
+ */
41
+ typedef struct _htmlElemDesc htmlElemDesc;
42
+ typedef htmlElemDesc *htmlElemDescPtr;
43
+ struct _htmlElemDesc {
44
+ const char *name; /* The tag name */
45
+ char startTag; /* Whether the start tag can be implied */
46
+ char endTag; /* Whether the end tag can be implied */
47
+ char saveEndTag; /* Whether the end tag should be saved */
48
+ char empty; /* Is this an empty element ? */
49
+ char depr; /* Is this a deprecated element ? */
50
+ char dtd; /* 1: only in Loose DTD, 2: only Frameset one */
51
+ char isinline; /* is this a block 0 or inline 1 element */
52
+ const char *desc; /* the description */
53
+
54
+ /* NRK Jan.2003
55
+ * New fields encapsulating HTML structure
56
+ *
57
+ * Bugs:
58
+ * This is a very limited representation. It fails to tell us when
59
+ * an element *requires* subelements (we only have whether they're
60
+ * allowed or not), and it doesn't tell us where CDATA and PCDATA
61
+ * are allowed. Some element relationships are not fully represented:
62
+ * these are flagged with the word MODIFIER
63
+ */
64
+ const char** subelts; /* allowed sub-elements of this element */
65
+ const char* defaultsubelt; /* subelement for suggested auto-repair
66
+ if necessary or NULL */
67
+ const char** attrs_opt; /* Optional Attributes */
68
+ const char** attrs_depr; /* Additional deprecated attributes */
69
+ const char** attrs_req; /* Required attributes */
70
+ };
71
+
72
+ /*
73
+ * Internal description of an HTML entity.
74
+ */
75
+ typedef struct _htmlEntityDesc htmlEntityDesc;
76
+ typedef htmlEntityDesc *htmlEntityDescPtr;
77
+ struct _htmlEntityDesc {
78
+ unsigned int value; /* the UNICODE value for the character */
79
+ const char *name; /* The entity name */
80
+ const char *desc; /* the description */
81
+ };
82
+
83
+ /*
84
+ * There is only few public functions.
85
+ */
86
+ XMLPUBFUN const htmlElemDesc * XMLCALL
87
+ htmlTagLookup (const xmlChar *tag);
88
+ XMLPUBFUN const htmlEntityDesc * XMLCALL
89
+ htmlEntityLookup(const xmlChar *name);
90
+ XMLPUBFUN const htmlEntityDesc * XMLCALL
91
+ htmlEntityValueLookup(unsigned int value);
92
+
93
+ XMLPUBFUN int XMLCALL
94
+ htmlIsAutoClosed(htmlDocPtr doc,
95
+ htmlNodePtr elem);
96
+ XMLPUBFUN int XMLCALL
97
+ htmlAutoCloseTag(htmlDocPtr doc,
98
+ const xmlChar *name,
99
+ htmlNodePtr elem);
100
+ XMLPUBFUN const htmlEntityDesc * XMLCALL
101
+ htmlParseEntityRef(htmlParserCtxtPtr ctxt,
102
+ const xmlChar **str);
103
+ XMLPUBFUN int XMLCALL
104
+ htmlParseCharRef(htmlParserCtxtPtr ctxt);
105
+ XMLPUBFUN void XMLCALL
106
+ htmlParseElement(htmlParserCtxtPtr ctxt);
107
+
108
+ XMLPUBFUN htmlParserCtxtPtr XMLCALL
109
+ htmlNewParserCtxt(void);
110
+
111
+ XMLPUBFUN htmlParserCtxtPtr XMLCALL
112
+ htmlCreateMemoryParserCtxt(const char *buffer,
113
+ int size);
114
+
115
+ XMLPUBFUN int XMLCALL
116
+ htmlParseDocument(htmlParserCtxtPtr ctxt);
117
+ XMLPUBFUN htmlDocPtr XMLCALL
118
+ htmlSAXParseDoc (const xmlChar *cur,
119
+ const char *encoding,
120
+ htmlSAXHandlerPtr sax,
121
+ void *userData);
122
+ XMLPUBFUN htmlDocPtr XMLCALL
123
+ htmlParseDoc (const xmlChar *cur,
124
+ const char *encoding);
125
+ XMLPUBFUN htmlDocPtr XMLCALL
126
+ htmlSAXParseFile(const char *filename,
127
+ const char *encoding,
128
+ htmlSAXHandlerPtr sax,
129
+ void *userData);
130
+ XMLPUBFUN htmlDocPtr XMLCALL
131
+ htmlParseFile (const char *filename,
132
+ const char *encoding);
133
+ XMLPUBFUN int XMLCALL
134
+ UTF8ToHtml (unsigned char *out,
135
+ int *outlen,
136
+ const unsigned char *in,
137
+ int *inlen);
138
+ XMLPUBFUN int XMLCALL
139
+ htmlEncodeEntities(unsigned char *out,
140
+ int *outlen,
141
+ const unsigned char *in,
142
+ int *inlen, int quoteChar);
143
+ XMLPUBFUN int XMLCALL
144
+ htmlIsScriptAttribute(const xmlChar *name);
145
+ XMLPUBFUN int XMLCALL
146
+ htmlHandleOmittedElem(int val);
147
+
148
+ #ifdef LIBXML_PUSH_ENABLED
149
+ /**
150
+ * Interfaces for the Push mode.
151
+ */
152
+ XMLPUBFUN htmlParserCtxtPtr XMLCALL
153
+ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax,
154
+ void *user_data,
155
+ const char *chunk,
156
+ int size,
157
+ const char *filename,
158
+ xmlCharEncoding enc);
159
+ XMLPUBFUN int XMLCALL
160
+ htmlParseChunk (htmlParserCtxtPtr ctxt,
161
+ const char *chunk,
162
+ int size,
163
+ int terminate);
164
+ #endif /* LIBXML_PUSH_ENABLED */
165
+
166
+ XMLPUBFUN void XMLCALL
167
+ htmlFreeParserCtxt (htmlParserCtxtPtr ctxt);
168
+
169
+ /*
170
+ * New set of simpler/more flexible APIs
171
+ */
172
+ /**
173
+ * xmlParserOption:
174
+ *
175
+ * This is the set of XML parser options that can be passed down
176
+ * to the xmlReadDoc() and similar calls.
177
+ */
178
+ typedef enum {
179
+ HTML_PARSE_RECOVER = 1<<0, /* Relaxed parsing */
180
+ HTML_PARSE_NODEFDTD = 1<<2, /* do not default a doctype if not found */
181
+ HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */
182
+ HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */
183
+ HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */
184
+ HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */
185
+ HTML_PARSE_NONET = 1<<11,/* Forbid network access */
186
+ HTML_PARSE_NOIMPLIED= 1<<13,/* Do not add implied html/body... elements */
187
+ HTML_PARSE_COMPACT = 1<<16,/* compact small text nodes */
188
+ HTML_PARSE_IGNORE_ENC=1<<21 /* ignore internal document encoding hint */
189
+ } htmlParserOption;
190
+
191
+ XMLPUBFUN void XMLCALL
192
+ htmlCtxtReset (htmlParserCtxtPtr ctxt);
193
+ XMLPUBFUN int XMLCALL
194
+ htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
195
+ int options);
196
+ XMLPUBFUN htmlDocPtr XMLCALL
197
+ htmlReadDoc (const xmlChar *cur,
198
+ const char *URL,
199
+ const char *encoding,
200
+ int options);
201
+ XMLPUBFUN htmlDocPtr XMLCALL
202
+ htmlReadFile (const char *URL,
203
+ const char *encoding,
204
+ int options);
205
+ XMLPUBFUN htmlDocPtr XMLCALL
206
+ htmlReadMemory (const char *buffer,
207
+ int size,
208
+ const char *URL,
209
+ const char *encoding,
210
+ int options);
211
+ XMLPUBFUN htmlDocPtr XMLCALL
212
+ htmlReadFd (int fd,
213
+ const char *URL,
214
+ const char *encoding,
215
+ int options);
216
+ XMLPUBFUN htmlDocPtr XMLCALL
217
+ htmlReadIO (xmlInputReadCallback ioread,
218
+ xmlInputCloseCallback ioclose,
219
+ void *ioctx,
220
+ const char *URL,
221
+ const char *encoding,
222
+ int options);
223
+ XMLPUBFUN htmlDocPtr XMLCALL
224
+ htmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
225
+ const xmlChar *cur,
226
+ const char *URL,
227
+ const char *encoding,
228
+ int options);
229
+ XMLPUBFUN htmlDocPtr XMLCALL
230
+ htmlCtxtReadFile (xmlParserCtxtPtr ctxt,
231
+ const char *filename,
232
+ const char *encoding,
233
+ int options);
234
+ XMLPUBFUN htmlDocPtr XMLCALL
235
+ htmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
236
+ const char *buffer,
237
+ int size,
238
+ const char *URL,
239
+ const char *encoding,
240
+ int options);
241
+ XMLPUBFUN htmlDocPtr XMLCALL
242
+ htmlCtxtReadFd (xmlParserCtxtPtr ctxt,
243
+ int fd,
244
+ const char *URL,
245
+ const char *encoding,
246
+ int options);
247
+ XMLPUBFUN htmlDocPtr XMLCALL
248
+ htmlCtxtReadIO (xmlParserCtxtPtr ctxt,
249
+ xmlInputReadCallback ioread,
250
+ xmlInputCloseCallback ioclose,
251
+ void *ioctx,
252
+ const char *URL,
253
+ const char *encoding,
254
+ int options);
255
+
256
+ /* NRK/Jan2003: further knowledge of HTML structure
257
+ */
258
+ typedef enum {
259
+ HTML_NA = 0 , /* something we don't check at all */
260
+ HTML_INVALID = 0x1 ,
261
+ HTML_DEPRECATED = 0x2 ,
262
+ HTML_VALID = 0x4 ,
263
+ HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */
264
+ } htmlStatus ;
265
+
266
+ /* Using htmlElemDesc rather than name here, to emphasise the fact
267
+ that otherwise there's a lookup overhead
268
+ */
269
+ XMLPUBFUN htmlStatus XMLCALL htmlAttrAllowed(const htmlElemDesc*, const xmlChar*, int) ;
270
+ XMLPUBFUN int XMLCALL htmlElementAllowedHere(const htmlElemDesc*, const xmlChar*) ;
271
+ XMLPUBFUN htmlStatus XMLCALL htmlElementStatusHere(const htmlElemDesc*, const htmlElemDesc*) ;
272
+ XMLPUBFUN htmlStatus XMLCALL htmlNodeStatus(const htmlNodePtr, int) ;
273
+ /**
274
+ * htmlDefaultSubelement:
275
+ * @elt: HTML element
276
+ *
277
+ * Returns the default subelement for this element
278
+ */
279
+ #define htmlDefaultSubelement(elt) elt->defaultsubelt
280
+ /**
281
+ * htmlElementAllowedHereDesc:
282
+ * @parent: HTML parent element
283
+ * @elt: HTML element
284
+ *
285
+ * Checks whether an HTML element description may be a
286
+ * direct child of the specified element.
287
+ *
288
+ * Returns 1 if allowed; 0 otherwise.
289
+ */
290
+ #define htmlElementAllowedHereDesc(parent,elt) \
291
+ htmlElementAllowedHere((parent), (elt)->name)
292
+ /**
293
+ * htmlRequiredAttrs:
294
+ * @elt: HTML element
295
+ *
296
+ * Returns the attributes required for the specified element.
297
+ */
298
+ #define htmlRequiredAttrs(elt) (elt)->attrs_req
299
+
300
+
301
+ #ifdef __cplusplus
302
+ }
303
+ #endif
304
+
305
+ #endif /* LIBXML_HTML_ENABLED */
306
+ #endif /* __HTML_PARSER_H__ */