3 * Copyright (C) 2006-2008 Jürg Billeter, Raffaele Sandrini, Michael Lawrence
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Jürg Billeter <j@bitron.ch>
21 * Raffaele Sandrini <rasa@gmx.ch>
22 * Michael Lawrence <lawremi@iastate.edu>
23 * Ondřej Jirman <megous@megous.com>
27 /* nanoftp - minimal FTP implementation */
29 [CCode (cname = "ftpDataCallback", cheader_filename = "libxml/nanoftp.h")]
30 public static delegate void FtpDataCallback (void* userData, [CCode (array_length = false)] char[] data, int len);
32 [CCode (cname = "ftpListCallback", cheader_filename = "libxml/nanoftp.h")]
33 public static delegate void FtpListCallback (void* userData, string filename, string attrib, string owner, string group, ulong size, int links, int year, string month, int day, int hour, int minute);
36 [CCode (cname = "void", free_function = "xmlNanoFTPFreeCtxt", cheader_filename = "libxml/nanoftp.h")]
37 public class NanoFTP {
38 [CCode (cname = "xmlNanoFTPCheckResponse")]
39 public int check_response ();
41 [CCode (cname = "xmlNanoFTPCleanup")]
42 public static void cleanup ();
44 [CCode (cname = "xmlNanoFTPClose")]
47 [CCode (cname = "xmlNanoFTPCloseConnection")]
48 public int close_connection ();
50 [CCode (cname = "xmlNanoFTPConnect")]
51 public int connect ();
53 [CCode (cname = "xmlNanoFTPConnectTo")]
54 public static NanoFTP* connect_to (string server, int port);
56 [CCode (cname = "xmlNanoFTPCwd")]
57 public int cwd (string directory);
59 [CCode (cname = "xmlNanoFTPDele")]
60 public int dele (string file);
62 [CCode (cname = "xmlNanoFTPGet")]
63 public int get (FtpDataCallback cb, void* user_data, string filename);
65 [CCode (cname = "xmlNanoFTPGetConnection")]
66 public int get_connection ();
68 [CCode (cname = "xmlNanoFTPGetResponse")]
69 public int get_response ();
71 [CCode (cname = "xmlNanoFTPGetSocket")]
72 public int get_socket (string filename);
74 [CCode (cname = "xmlNanoFTPInit")]
75 public static void init ();
77 [CCode (cname = "xmlNanoFTPList")]
78 public int list (FtpListCallback cb, void* user_data, string filename);
80 [CCode (cname = "xmlNanoFTPNewCtxt")]
81 public NanoFTP (string url);
83 [CCode (cname = "xmlNanoFTPOpen")]
84 public static NanoFTP* open (string url);
86 [CCode (cname = "xmlNanoFTPProxy")]
87 public static void proxy (string host, int port, string user, string passwd, int type);
89 [CCode (cname = "xmlNanoFTPQuit")]
92 [CCode (cname = "xmlNanoFTPRead")]
93 public int read (void* dest, int len);
95 [CCode (cname = "xmlNanoFTPScanProxy")]
96 public static void scan_proxy (string url);
98 [CCode (cname = "xmlNanoFTPUpdateURL")]
99 public int update_url (string url);
103 /* nanohttp - minimal HTTP implementation */
106 [CCode (cname = "void", cheader_filename = "libxml/nanohttp.h")]
107 public class NanoHTTP {
108 [CCode (cname = "xmlNanoHTTPAuthHeader")]
109 public weak string auth_header ();
111 [CCode (cname = "xmlNanoHTTPCleanup")]
112 public static void cleanup ();
114 [CCode (cname = "xmlNanoHTTPClose")]
117 [CCode (cname = "xmlNanoHTTPContentLength")]
118 public int content_length ();
120 [CCode (cname = "xmlNanoHTTPEncoding")]
121 public weak string http_encoding ();
123 [CCode (cname = "xmlNanoHTTPFetch")]
124 public static int fetch (string url, string filename, out string content_type);
126 [CCode (cname = "xmlNanoHTTPInit")]
127 public static void init ();
129 [CCode (cname = "xmlNanoHTTPMethod")]
130 public static NanoHTTP* method (string url, string method, string input, out string content_type, string headers, int ilen);
132 [CCode (cname = "xmlNanoHTTPMethodRedir")]
133 public static NanoHTTP* method_redir (string url, string method, string input, out string content_type, out string redir, string headers, int ilen);
135 [CCode (cname = "xmlNanoHTTPMimeType")]
136 public string mime_type ();
138 [CCode (cname = "xmlNanoHTTPOpen")]
139 public static NanoHTTP* open (string url, out string content_type);
141 [CCode (cname = "xmlNanoHTTPOpenRedir")]
142 public static NanoHTTP* open_redir (string url, out string content_type, out string redir);
144 [CCode (cname = "xmlNanoHTTPRead")]
145 public int read (void* dest, int len);
147 [CCode (cname = "xmlNanoHTTPRedir")]
148 public weak string redir ();
150 [CCode (cname = "xmlNanoHTTPReturnCode")]
151 public int return_code ();
153 [CCode (cname = "xmlNanoHTTPSave")]
154 public int save (string filename);
156 [CCode (cname = "xmlNanoHTTPScanProxy")]
157 public static void scan_proxy (string URL);
161 /* parser - the core parser module */
163 [CCode (cheader_filename = "libxml/parser.h")]
165 [CCode (cname = "xmlCleanupParser")]
166 public static void cleanup ();
168 [CCode (cname = "xmlInitParser")]
169 public static void init ();
171 [CCode (cname = "xmlParseDoc")]
172 public static Doc* parse_doc (string cur);
174 [CCode (cname = "xmlParseFile")]
175 public static Doc* parse_file (string filename);
177 [CCode (cname = "xmlParseMemory")]
178 public static Doc* parse_memory (string buffer, int size);
180 [CCode (cname = "xmlReadDoc")]
181 public static Doc* read_doc (string cur, string? url = null, string? encoding = null, int options = 0);
183 [CCode (cname = "xmlReadFd")]
184 public static Doc* read_fd (int fd, string? base_url = null, string? encoding = null, int options = 0);
186 [CCode (cname = "xmlReadFile")]
187 public static Doc* read_file (string filename, string? encoding = null, int options = 0);
189 [CCode (cname = "xmlReadMemory")]
190 public static Doc* read_memory (string text, int len, string? url = null, string? encoding = null, int options = 0);
193 [CCode (cname = "xmlParserOption", cprefix = "XML_PARSE_", cheader_filename = "libxml/parser.h")]
194 public enum ParserOption {
215 /* tree - interfaces for tree manipulation */
217 [CCode (cheader_filename = "libxml/tree.h")]
219 [CCode (cname = "xmlGetCompressMode")]
220 public static int get_compress_mode ();
222 [CCode (cname = "xmlIsXHTML")]
223 public static int is_xhtml (string system_id, string public_id);
225 [CCode (cname = "xmlSetCompressMode")]
226 public static void set_compress_mode (int mode);
230 [CCode (cname = "xmlAttr", cheader_filename = "libxml/tree.h")]
232 public ElementType type;
233 public weak string name;
234 public Node* children;
241 public AttributeType atype;
243 [CCode (cname = "xmlRemoveProp")]
248 [CCode (cname = "xmlAttribute", cheader_filename = "libxml/tree.h")]
249 public class Attribute {
250 public ElementType type;
251 public weak string name;
252 public Node* children;
258 public Attribute* nexth;
259 public AttributeType atype;
260 public AttributeDefault def;
261 public weak string default_value;
262 public weak string prefix;
263 public weak string elem;
266 [CCode (cname = "xmlAttributeDefault", cprefix = "XML_ATTRIBUTE_", cheader_filename = "libxml/tree.h")]
267 public enum AttributeDefault {
274 [CCode (cname = "xmlAttributeType", cprefix = "XML_ATTRIBUTE_", cheader_filename = "libxml/tree.h")]
275 public enum AttributeType {
289 [CCode (cname = "xmlDoc", free_function = "xmlFreeDoc", cheader_filename = "libxml/tree.h,libxml/parser.h")]
291 public ElementType type;
293 public Node* children;
299 public int compression;
300 public int standalone;
301 public Dtd* int_subset;
302 public Dtd* ext_subset;
304 public weak string version;
305 public weak string encoding;
306 public weak string url;
309 [CCode (cname = "xmlCopyDoc")]
310 public Doc* copy (int recursive);
312 [CCode (cname = "xmlCreateIntSubset")]
313 public Dtd* create_int_subset (string name, string external_id, string system_id);
315 [CCode (cname = "xmlDocDump")]
316 public static int dump (GLib.FileStream f, Doc* cur);
318 [CCode (cname = "xmlDocDumpFormatMemory")]
319 public void dump_memory_format (out string mem, out int len = null, bool format = true);
321 [CCode (cname = "xmlDocDumpFormatMemoryEnc")]
322 public void dump_memory_enc_format (out string mem, out int len = null, string enc = "UTF-8", bool format = true);
324 [CCode (cname = "xmlDocDumpMemory")]
325 public void dump_memory (out string mem, out int len = null);
327 [CCode (cname = "xmlDocDumpMemoryEnc")]
328 public void dump_memory_enc (out string mem, out int len = null, string enc = "UTF-8");
330 [CCode (cname = "xmlDocFormatDump")]
331 public static int dump_format (GLib.FileStream f, Doc* cur, bool format = true);
333 [CCode (cname = "xmlDocGetRootElement")]
334 public Node* get_root_element();
336 [CCode (cname = "xmlDocSetRootElement")]
337 public Node* set_root_element(Node* root);
339 [CCode (cname = "xmlElemDump")]
340 public static void elem_dump (GLib.FileStream f, Doc* doc, Node* cur);
342 [CCode (cname = "xmlGetDocCompressMode")]
343 public int get_compress_mode ();
345 [CCode (cname = "xmlNewCDataBlock")]
346 public Node* new_cdata_block (string content, int len);
348 [CCode (cname = "xmlNewCharRef")]
349 public Node* new_char_ref (string name);
351 [CCode (cname = "xmlNewDoc")]
352 public Doc (string version);
354 [CCode (cname = "xmlNewDocComment")]
355 public Node* new_comment (string content);
357 [CCode (cname = "xmlNewDocFragment")]
358 public Node* new_fragment ();
360 [CCode (cname = "xmlNewDocNode")]
361 public Node* new_node (Ns* ns, string name, string? content = null);
363 [CCode (cname = "xmlNewDocNodeEatName")]
364 public Node* new_node_eat_name (Ns* ns, string# name, string? content = null);
366 [CCode (cname = "xmlNewDocPI")]
367 public Node* new_pi (string name, string content);
369 [CCode (cname = "xmlNewDocProp")]
370 public Attr* new_prop (string name, string value);
372 [CCode (cname = "xmlNewDocRawNode")]
373 public Node* new_raw_node (Ns* ns, string name, string content);
375 [CCode (cname = "xmlNewDocText")]
376 public Node* new_text (string content);
378 [CCode (cname = "xmlNewDocTextLen")]
379 public Node* new_text_len (string content, int len);
381 [CCode (cname = "xmlNewReference")]
382 public Node* new_reference (string name);
384 [CCode (cname = "xmlNodeListGetRawString")]
385 public string node_list_get_raw_string (Node* list, int _inline);
387 [CCode (cname = "xmlNodeListGetString")]
388 public string node_list_get_string (Node* list, int _inline);
390 [CCode (cname = "xmlSaveFile", instance_pos = -1)]
391 public int save_file (string filename);
393 [CCode (cname = "xmlSaveFileEnc")]
394 public static void save_file_enc (string filename, Doc* cur, string enc = "UTF-8");
396 [CCode (cname = "xmlSaveFormatFile")]
397 public static void save_format_file (string filename, Doc* cur, int format);
399 [CCode (cname = "xmlSaveFormatFileEnc")]
400 public static void save_format_file_enc (string filename, Doc* cur, string enc, int format);
402 [CCode (cname = "xmlSetDocCompressMode")]
403 public void set_compress_mode (int mode);
405 [CCode (cname = "xmlStringGetNodeList")]
406 public Node* string_get_node_list (string str);
408 [CCode (cname = "xmlStringLenGetNodeList")]
409 public Node* string_len_get_node_list (string str, int len);
413 [CCode (cname = "xmlDtd", cheader_filename = "libxml/tree.h")]
415 public ElementType type;
417 public Node* children;
424 public weak string external_id;
425 public weak string system_id;
427 [CCode (cname = "xmlNewDtd")]
428 public Dtd (Doc* doc, string name, string external_id, string system_id);
430 [CCode (cname = "xmlCopyDtd")]
435 [CCode (cname = "xmlElement", cheader_filename = "libxml/tree.h")]
436 public class Element {
437 public ElementType type;
438 public weak string name;
439 public Node* children;
445 public Attribute* attributes;
446 public weak string prefix;
449 [CCode (cname = "xmlElementType", cprefix = "XML_", cheader_filename = "libxml/tree.h")]
450 public enum ElementType {
475 [CCode (cname = "xmlElementContent", free_function = "xmlFreeElementContent", cheader_filename = "libxml/tree.h")]
476 public class ElementContent {
477 [CCode (cname = "xmlNewElementContent")]
478 ElementContent (string name, ElementContentType type);
480 public ElementContentType type;
481 public ElementContentOccur ocur;
482 public const string name;
483 public ElementContent c1;
484 public ElementContent c2;
485 public ElementContent parent;
486 public const string prefix;
489 [CCode (cname = "xmlElementContentType", cprefix = "XML_ELEMENT_CONTENT_", cheader_filename = "libxml/tree.h")]
490 public enum ElementContentType {
497 [CCode (cname = "xmlElementContentOccur", cprefix = "XML_ELEMENT_CONTENT_", cheader_filename = "libxml/tree.h")]
498 public enum ElementContentOccur {
506 [CCode (cname = "xmlEntity", cheader_filename = "libxml/tree.h")]
507 public struct Entity {
508 public void* private;
509 public ElementType type;
510 public const string name;
511 public Node* children;
518 public string content;
520 public EntityType etype;
521 public const string ExternalID;
522 public const string SystemID;
523 public Entity* nexte;
524 public const string URI;
529 [CCode (cname = "xmlEntityType", cprefix = "XML_", cheader_filename = "libxml/tree.h")]
530 public enum EntityType {
531 INTERNAL_GENERAL_ENTITY,
532 EXTERNAL_GENERAL_PARSED_ENTITY,
533 EXTERNAL_GENERAL_UNPARSED_ENTITY,
534 INTERNAL_PARAMETER_ENTITY,
535 EXTERNAL_PARAMETER_ENTITY,
536 INTERNAL_PREDEFINED_ENTITY
540 [CCode (cname = "xmlEnumeration", cheader_filename = "libxml/tree.h")]
541 public struct Enumeration {
542 public Enumeration* next;
543 public const string name;
548 [CCode (cname = "xmlNode", free_function = "xmlFreeNode", cheader_filename = "libxml/tree.h")]
550 public ElementType type;
551 public weak string name;
552 public Node* children;
559 public string content;
560 public Attr* properties;
565 [CCode (cname = "xmlAddChild")]
566 public Node* add_child (Node* cur);
568 [CCode (cname = "xmlAddChildList")]
569 public Node* add_child_list (Node* cur);
571 [CCode (cname = "xmlAddNextSibling")]
572 public Node* add_next_sibling (Node* elem);
574 [CCode (cname = "xmlAddPrevSibling")]
575 public Node* add_prev_sibling (Node* elem);
577 [CCode (cname = "xmlAddSibling")]
578 public Node* add_sibling (Node* elem);
580 [CCode (cname = "xmlCopyNode")]
581 public Node* copy (int extended);
583 [CCode (cname = "xmlCopyNodeList")]
584 public Node copy_list();
586 [CCode (cname = "xmlDocCopyNode")]
587 public Node* doc_copy (Doc* doc, int extended);
589 [CCode (cname = "xmlDocCopyNodeList")]
590 public Node* doc_copy_list (Doc* doc);
592 [CCode (cname = "xmlFreeNodeList")]
593 public void free_list ();
595 [CCode (cname = "xmlGetLastChild")]
596 public Node* get_last_child ();
598 [CCode (cname = "xmlGetLineNo")]
599 public long get_line_no ();
601 [CCode (cname = "xmlGetNoNsProp")]
602 public string get_no_ns_prop (string name);
604 [CCode (cname = "xmlGetNodePath")]
605 public string get_path ();
607 [CCode (cname = "xmlGetNsProp")]
608 public string get_ns_prop (string name, string ns);
610 [CCode (cname = "xmlGetProp")]
611 public string get_prop (string name);
613 [CCode (cname = "xmlHasNsProp")]
614 public Attr* has_ns_prop (string name, string name_space);
616 [CCode (cname = "xmlHasProp")]
617 public Attr* has_prop (string name);
619 [CCode (cname = "xmlIsBlankNode")]
620 public int is_blank ();
622 [CCode (cname = "xmlNewChild")]
623 public Node* new_child (Ns* ns, string name, string? content = null);
625 [CCode (cname = "xmlNewNs")]
626 public Ns* new_ns (string href, string prefix);
628 [CCode (cname = "xmlNewNsProp")]
629 public Attr* new_ns_prop (Ns* ns, string name, string value);
631 [CCode (cname = "xmlNewProp")]
632 public Attr* new_prop (string name, string value);
634 [CCode (cname = "xmlNewTextChild")]
635 public Node* new_text_child (Ns* ns, string name, string content);
637 [CCode (cname = "xmlNodeAddContent")]
638 public void add_content (string content);
640 [CCode (cname = "xmlNodeAddContentLen")]
641 public void add_content_len (string content, int len);
643 [CCode (cname = "xmlNodeGetContent")]
644 public string get_content();
646 [CCode (cname = "xmlNodeGetLang")]
647 public string get_lang();
649 [CCode (cname = "xmlNodeGetSpacePreserve")]
650 public int get_space_preserve();
652 [CCode (cname = "xmlNodeIsText")]
653 public int is_text();
655 [CCode (cname = "xmlNodeSetContent")]
656 public void set_content (string content);
658 [CCode (cname = "xmlNodeSetContentLen")]
659 public void set_content_len (string content, int len);
661 [CCode (cname = "xmlNodeSetLang")]
662 public void set_lang (string val);
664 [CCode (cname = "xmlNodeSetName")]
665 public void set_name (string name);
667 [CCode (cname = "xmlNodeSetSpacePreserve")]
668 public void set_space_preserve (int val);
670 [CCode (cname = "xmlReplaceNode")]
671 public Node* replace (Node* cur);
673 [CCode (cname = "xmlNewComment")]
674 public Node.comment (string content);
676 [CCode (cname = "xmlNewNode")]
677 public Node (Ns* ns, string name);
679 [CCode (cname = "xmlNewNodeEatName")]
680 public Node.eat_name (Ns* ns, string# name);
682 [CCode (cname = "xmlNewText")]
683 public Node.text (string content);
685 [CCode (cname = "xmlNewTextLen")]
686 public Node.text_len (string content, int len);
688 [CCode (cname = "xmlNewPI")]
689 public Node.pi (string name, string content);
691 [CCode (cname = "xmlSetListDoc")]
692 public void set_list_doc (Doc* doc);
694 [CCode (cname = "xmlSetNsProp")]
695 public Attr* set_ns_prop (Ns* ns, string name, string value);
697 [CCode (cname = "xmlSetProp")]
698 public Attr* set_prop (string name, string value);
700 [CCode (cname = "xmlSetTreeDoc")]
701 public void set_tree_doc (Doc* doc);
703 [CCode (cname = "xmlTextConcat")]
704 public int text_concat (string content, int len);
706 [CCode (cname = "xmlTextMerge")]
707 public Node* text_merge (Node* second);
709 [CCode (cname = "xmlUnlinkNode")]
710 public void unlink ();
712 [CCode (cname = "xmlUnsetNsProp")]
713 public int unset_ns_prop (Ns* ns, string name);
715 [CCode (cname = "xmlUnsetProp")]
716 public int unset_prop (string name);
720 [CCode (cname = "xmlNs", cheader_filename = "libxml/tree.h")]
723 public ElementType type;
725 public string prefix;
730 [CCode (cname = "xmlParserCtxt")]
731 public class ParserCtxt {
732 public SAXHandler* sax;
733 public void* user_data;
735 [CCode (cname = "xmlParseDocument")]
736 public int parse_document ();
740 /* uri - library of generic URI related routines */
743 [CCode (cname = "xmlURI", free_function = "xmlFreeURI", cheader_filename = "libxml/uri.h")]
745 [CCode (cname = "xmlBuildRelativeURI")]
746 public static string build_relative (string uri, string @base);
748 [CCode (cname = "xmlBuildURI")]
749 public static string build (string URI, string @base);
751 [CCode (cname = "xmlCanonicPath")]
752 public static string canonic_path (string path);
754 [CCode (cname = "xmlCreateURI")]
757 [CCode (cname = "xmlNormalizeURIPath")]
758 public static int normalize_uri_path (string path);
760 [CCode (cname = "xmlParseURI")]
761 public static URI parse (string str);
763 [CCode (cname = "xmlParseURIRaw")]
764 public static URI parse_raw (string str, int raw);
766 [CCode (cname = "xmlParseURIReference")]
767 public int parse_reference (string str);
769 [CCode (cname = "xmlPathToURI")]
770 public static string path_to_uri (string path);
772 [CCode (cname = "xmlPrintURI", instance_pos = -1)]
773 public void print (GLib.FileStream stream);
775 [CCode (cname = "xmlSaveUri")]
776 public string save ();
778 [CCode (cname = "xmlURIEscape")]
779 public static string escape (string str);
781 [CCode (cname = "xmlURIEscapeStr")]
782 public static string escape_str (string str, string list);
784 [CCode (cname = "xmlURIUnescapeString")]
785 public static string unescape_string (string str, int len, string? target);
787 public string scheme;
788 public string opaque;
789 public string authority;
790 public string server;
795 public string fragment;
797 public string query_raw;
801 /* xmlIO - interface for the I/O interfaces used by the parser */
803 [CCode (cname = "xmlInputCloseCallback", cheader_filename = "libxml/xmlIO.h")]
804 public static delegate int InputCloseCallback (void* context);
806 [CCode (cname = "xmlInputReadCallback", cheader_filename = "libxml/xmlIO.h")]
807 public static delegate int InputReadCallback (void* context, [CCode (array_length = false)] char[] buffer, int len);
810 /* xmlschemas - incomplete XML Schemas structure implementation */
813 [CCode (cname = "xmlSchemaValidCtxt", cheader_filename = "libxml/xmlreader.h")]
814 public class SchemaValidCtxt {
818 /* xmlreader - the XMLReader implementation */
820 [CCode (cname = "xmlParserProperties", cprefix = "XML_PARSER_", cheader_filename = "libxml/xmlreader.h")]
821 public enum ParserProperties {
828 [CCode (cname = "xmlParserSeverities", cprefix = "XML_PARSER_SEVERITY_", cheader_filename = "libxml/xmlreader.h")]
829 public enum ParserSeverities {
836 [CCode (cname = "xmlReaderTypes", cheader_filename = "libxml/xmlreader.h")]
837 public enum ReaderType {
845 PROCESSING_INSTRUCTION,
852 SIGNIFICANT_WHITESPACE,
859 [CCode (cname = "xmlTextReader", free_function = "xmlFreeTextReader", cheader_filename = "libxml/xmlreader.h")]
860 public class TextReader {
861 [CCode (cname = "xmlNewTextReaderFilename")]
862 public TextReader.filename (string uri);
864 [CCode (cname = "xmlReaderForDoc")]
865 public TextReader.for_doc (string cur, string url, string? encoding, int options);
867 [CCode (cname = "xmlReaderForFd")]
868 public TextReader.for_fd (int fd, string url, string? encoding, int options);
870 [CCode (cname = "xmlReaderForFile")]
871 public TextReader.for_file (string filename, string? encoding, int options);
873 [CCode (cname = "xmlReaderForIO")]
874 public TextReader.for_io (InputReadCallback ioread, InputCloseCallback ioclose, void* ioctx, string url, string encoding, int options);
876 [CCode (cname = "xmlReaderForMemory")]
877 public TextReader.for_memory ([CCode (array_length = false)] char[] buffer, int size, string url, string encoding, int options);
879 [CCode (cname = "xmlReaderNewDoc")]
880 public int new_doc (string cur, string url, string? encoding, int options);
882 [CCode (cname = "xmlReaderNewFd")]
883 public int new_fd (int fd, string url, string? encoding, int options);
885 [CCode (cname = "xmlReaderNewFile")]
886 public int new_file (string filename, string? encoding, int options);
888 [CCode (cname = "xmlReaderNewIO")]
889 public int new_io (InputReadCallback ioread, InputCloseCallback ioclose, void* ioctx, string url, string encoding, int options);
891 [CCode (cname = "xmlReaderNewMemory")]
892 public int new_memory ([CCode (array_length = false)] char[] buffer, int size, string url, string? encoding, int options);
894 [CCode (cname = "xmlReaderNewWalker")]
895 public int new_walker (Doc* doc);
897 [CCode (cname = "xmlReaderWalker")]
898 public TextReader.walker (Doc* doc);
900 [CCode (cname = "xmlTextReaderAttributeCount")]
901 public int attribute_count ();
903 [CCode (cname = "xmlTextReaderBaseUri")]
904 public string base_uri ();
906 [CCode (cname = "xmlTextReaderByteConsumed")]
907 public long byte_consumed ();
909 [CCode (cname = "xmlTextReaderClose")]
912 [CCode (cname = "xmlTextReaderConstBaseUri")]
913 public weak string const_base_uri ();
915 [CCode (cname = "xmlTextReaderConstEncoding")]
916 public weak string const_encoding ();
918 [CCode (cname = "xmlTextReaderConstLocalName")]
919 public weak string const_local_name ();
921 [CCode (cname = "xmlTextReaderConstName")]
922 public weak string const_name ();
924 [CCode (cname = "xmlTextReaderConstNamespaceUri")]
925 public weak string const_namespace_uri ();
927 [CCode (cname = "xmlTextReaderConstPrefix")]
928 public weak string const_prefix ();
930 [CCode (cname = "xmlTextReaderConstString")]
931 public weak string const_string (string str);
933 [CCode (cname = "xmlTextReaderConstValue")]
934 public weak string const_value ();
936 [CCode (cname = "xmlTextReaderConstXmlLang")]
937 public weak string const_xml_lang ();
939 [CCode (cname = "xmlTextReaderConstXmlVersion")]
940 public weak string const_xml_version ();
942 [CCode (cname = "xmlTextReaderCurrentDoc")]
943 public Doc* current_doc ();
945 [CCode (cname = "xmlTextReaderCurrentNode")]
946 public Node* current_node ();
948 [CCode (cname = "xmlTextReaderDepth")]
951 [CCode (cname = "xmlTextReaderExpand")]
952 public Node* expand ();
954 [CCode (cname = "xmlTextReaderGetAttribute")]
955 public string get_attribute (string name);
957 [CCode (cname = "xmlTextReaderGetAttributeNo")]
958 public string get_attribute_no (int no);
960 [CCode (cname = "xmlTextReaderGetAttributeNs")]
961 public string get_attribute_ns (string local_name, string namespace_uri);
963 [CCode (cname = "xmlTextReaderGetErrorHandler")]
964 public void get_error_handler (out TextReaderErrorFunc f, void** arg);
966 [CCode (cname = "xmlTextReaderGetParserColumnNumber")]
967 public int get_parser_column_number ();
969 [CCode (cname = "xmlTextReaderGetParserLineNumber")]
970 public int get_parser_line_number ();
972 [CCode (cname = "xmlTextReaderGetParserProp")]
973 public int get_parser_prop (int prop);
975 [CCode (cname = "xmlTextReaderHasAttributes")]
976 public int has_attributes ();
978 [CCode (cname = "xmlTextReaderHasValue")]
979 public int has_value ();
981 [CCode (cname = "xmlTextReaderIsDefault")]
982 public int is_default ();
984 [CCode (cname = "xmlTextReaderIsEmptyElement")]
985 public int is_empty_element ();
987 [CCode (cname = "xmlTextReaderIsNamespaceDecl")]
988 public int is_namespace_decl ();
990 [CCode (cname = "xmlTextReaderIsValid")]
991 public int is_valid ();
993 [CCode (cname = "xmlTextReaderLocalName")]
994 public string local_name ();
996 [CCode (cname = "xmlTextReaderLookupNamespace")]
997 public string lookup_namespace (string prefix);
999 [CCode (cname = "xmlTextReaderMoveToAttribute")]
1000 public int move_to_attribute (string name);
1002 [CCode (cname = "xmlTextReaderMoveToAttributeNo")]
1003 public int move_to_attribute_no (int no);
1005 [CCode (cname = "xmlTextReaderMoveToAttributeNs")]
1006 public int move_to_attribute_ns (string local_name, string namespace_uri);
1008 [CCode (cname = "xmlTextReaderMoveToElement")]
1009 public int move_to_element ();
1011 [CCode (cname = "xmlTextReaderMoveToFirstAttribute")]
1012 public int move_to_first_attribute ();
1014 [CCode (cname = "xmlTextReaderMoveToNextAttribute")]
1015 public int move_to_next_attribute ();
1017 [CCode (cname = "xmlTextReaderName")]
1018 public string name ();
1020 [CCode (cname = "xmlTextReaderNamespaceUri")]
1021 public string namespace_uri ();
1023 [CCode (cname = "xmlTextReaderNext")]
1026 [CCode (cname = "xmlTextReaderNextSibling")]
1027 public int next_sibling ();
1029 [CCode (cname = "xmlTextReaderNodeType")]
1030 public int node_type ();
1032 [CCode (cname = "xmlTextReaderNormalization")]
1033 public int normalization ();
1035 [CCode (cname = "xmlTextReaderPrefix")]
1036 public string prefix ();
1038 [CCode (cname = "xmlTextReaderPreserve")]
1039 public Node* preserve ();
1041 [CCode (cname = "xmlTextReaderPreservePattern")]
1042 public int preserve_pattern (string pattern, [CCode (array_length = false)] string[] namespaces);
1044 [CCode (cname = "xmlTextReaderQuoteChar")]
1045 public int quote_char ();
1047 [CCode (cname = "xmlTextReaderRead")]
1050 [CCode (cname = "xmlTextReaderReadAttributeValue")]
1051 public int read_attribute_value ();
1053 [CCode (cname = "xmlTextReaderReadInnerXml")]
1054 public string read_inner_xml ();
1056 [CCode (cname = "xmlTextReaderReadOuterXml")]
1057 public string read_outer_xml ();
1059 [CCode (cname = "xmlTextReaderReadState")]
1060 public int read_state ();
1062 [CCode (cname = "xmlTextReaderReadString")]
1063 public string read_string ();
1065 [CCode (cname = "xmlTextReaderSchemaValidate")]
1066 public int schema_validate (string xsd);
1068 [CCode (cname = "xmlTextReaderSchemaValidateCtxt")]
1069 public int schema_validate_ctxt (SchemaValidCtxt* ctxt, int options);
1071 [CCode (cname = "xmlTextReaderSetErrorHandler")]
1072 public void set_error_handler (TextReaderErrorFunc f, void* arg);
1074 [CCode (cname = "xmlTextReaderSetParserProp")]
1075 public int set_parser_prop (SchemaValidCtxt* ctxt, int options);
1077 [CCode (cname = "xmlTextReaderStandalone")]
1078 public int standalone ();
1080 [CCode (cname = "xmlTextReaderValue")]
1081 public string value ();
1083 [CCode (cname = "xmlTextReaderXmlLang")]
1084 public string xml_lang ();
1088 [CCode (cname = "void", cheader_filename = "libxml/xmlreader.h")]
1089 public class TextReaderLocator {
1092 [CCode (cname = "xmlTextReaderMode", cprefix = "XML_TEXTREADER_MODE_", cheader_filename = "libxml/xmlreader.h")]
1093 public enum TextReaderMode {
1102 public static delegate void TextReaderErrorFunc (void* arg, string msg, ParserSeverities severity, TextReaderLocator* locator);
1105 /* xpath - XML Path Language implementation */
1107 [CCode (cheader_filename = "libxml/xpath.h")]
1109 [CCode (cname = "xmlXPathOrderDocElems")]
1110 public static long order_doc_elements (Doc* doc);
1114 [CCode (cname = "xmlNodeSet", cheader_filename = "libxml/xpath.h")]
1115 public class NodeSet {
1116 [CCode (cname = "xmlXPathNodeSetGetLength")]
1117 public int length ();
1119 [CCode (cname = "xmlXPathNodeSetIsEmpty")]
1120 public bool is_empty ();
1122 [CCode (cname = "xmlXPathNodeSetItem")]
1123 public Node* item (int index);
1127 [CCode (cname = "xmlXPathContext", free_function = "xmlXPathFreeContext", cheader_filename = "libxml/xpath.h")]
1128 public class XPathContext {
1132 [CCode (cname = "xmlXPathContextSetCache")]
1133 public int set_cache (int active, int value, int options);
1135 [CCode (cname = "xmlXPathEval", instance_pos = -1)]
1136 public XPathObject* eval (string str);
1138 [CCode (cname = "xmlXPathEvalExpression", instance_pos = -1)]
1139 public XPathObject* eval_expression (string str);
1141 [CCode (cname = "xmlXPathNewContext")]
1142 public XPathContext (Doc* doc);
1145 [CCode (cname = "xmlXPathError", cprefix = "", cheader_filename = "libxml/xpath.h")]
1146 public enum XPathError {
1147 XPATH_EXPRESSION_OK,
1149 XPATH_UNFINISHED_LITERAL_ERROR,
1150 XPATH_START_LITERAL_ERROR,
1151 XPATH_VARIABLE_REF_ERROR,
1152 XPATH_UNDEF_VARIABLE_ERROR,
1153 XPATH_INVALID_PREDICATE_ERROR,
1155 XPATH_UNCLOSED_ERROR,
1156 XPATH_UNKNOWN_FUNC_ERROR,
1157 XPATH_INVALID_OPERAND,
1159 XPATH_INVALID_ARITY,
1160 XPATH_INVALID_CTXT_SIZE,
1161 XPATH_INVALID_CTXT_POSITION,
1164 XPTR_RESOURCE_ERROR,
1165 XPTR_SUB_RESOURCE_ERROR,
1166 XPATH_UNDEF_PREFIX_ERROR,
1167 XPATH_ENCODING_ERROR,
1168 XPATH_INVALID_CHAR_ERROR,
1173 [CCode (cname = "xmlXPathObject", cheader_filename = "libxml/xpath.h")]
1174 public class XPathObject {
1175 public XPathObjectType type;
1176 public NodeSet* nodesetval;
1178 public double floatval;
1179 public string stringval;
1186 [CCode (cname = "xmlXPathObjectType", cprefix = "XPATH_", cheader_filename = "libxml/xpath.h")]
1187 public enum XPathObjectType {
1203 [CCode (cname = "attributeDeclSAXFunc")]
1204 public static delegate void attributeDeclSAXFunc (void* ctx, string elem, string fullname, int type, int def, string defaultValue, Enumeration* tree);
1206 [CCode (cname = "attributeSAXFunc")]
1207 public static delegate void attributeSAXFunc (void* ctx, string name, string value);
1209 [CCode (cname = "cdataBlockSAXFunc")]
1210 public static delegate void cdataBlockSAXFunc (void* ctx, string value, int len);
1212 [CCode (cname = "charactersSAXFunc")]
1213 public static delegate void charactersSAXFunc (void* ctx, string ch, int len);
1215 [CCode (cname = "commentsSAXFunc")]
1216 public static delegate void commentSAXFunc (void* ctx, string value);
1218 [CCode (cname = "elementDeclSAXFunc")]
1219 public static delegate void elementDeclSAXFunc (void* ctx, string name, int type, ElementContent content);
1221 [CCode (cname = "endDocumentSAXFunc")]
1222 public static delegate void endDocumentSAXFunc (void* ctx);
1224 [CCode (cname = "endElementNsSAX2Func")]
1225 public static delegate void endElementNsSAX2Func (void* ctx, string localname, string prefix, string URI);
1227 [CCode (cname = "endElementSAXFunc")]
1228 public static delegate void endElementSAXFunc (void* ctx, string name);
1230 [CCode (cname = "entityDeclSAXFunc")]
1231 public static delegate void entityDeclSAXFunc (void* ctx, string name, int type, string publicId, string systemId, string content);
1233 [CCode (cname = "errorSAXFunc")]
1234 public static delegate void errorSAXFunc (void* ctx, string msg, ...);
1236 [CCode (cname = "externalSubsetSAXFunc")]
1237 public static delegate void externalSubsetSAXFunc (void* ctx, string name, string ExternalID, string SystemID);
1239 [CCode (cname = "fatalErrorSAXFunc")]
1240 public static delegate void fatalErrorSAXFunc (void* ctx, string msg, ...);
1242 [CCode (cname = "getEntitySAXFunc")]
1243 public static delegate Entity* getEntitySAXFunc (void* ctx, string name);
1245 [CCode (cname = "getParameterEntitySAXFunc")]
1246 public static delegate Entity* getParameterEntitySAXFunc (void* ctx, string name);
1248 [CCode (cname = "hasExternalSubsetSAXFunc")]
1249 public static delegate int hasExternalSubsetSAXFunc (void* ctx);
1251 [CCode (cname = "hasInternalSubsetSAXFunc")]
1252 public static delegate int hasInternalSubsetSAXFunc (void* ctx);
1254 [CCode (cname = "ignorableWhitespaceSAXFunc")]
1255 public static delegate void ignorableWhitespaceSAXFunc (void* ctx, string ch, int len);
1257 [CCode (cname = "internalSubsetSAXFunc")]
1258 public static delegate void internalSubsetSAXFunc (void* ctx, string name, string ExternalID, string SystemID);
1260 [CCode (cname = "isStandaloneSAXFunc")]
1261 public static delegate int isStandaloneSAXFunc (void* ctx);
1263 [CCode (cname = "notationDeclSAXFunc")]
1264 public static delegate void notationDeclSAXFunc (void* ctx, string name, string publicId, string systemId);
1266 [CCode (cname = "processingInstructionSAXFunc")]
1267 public static delegate void processingInstructionSAXFunc (void* ctx, string target, string data);
1269 [CCode (cname = "referenceSAXFunc")]
1270 public static delegate void referenceSAXFunc (void* ctx, string name);
1272 // [CCode (cname = "resolveEntitySAXFunc")]
1273 // public static delegate ParserInput resolveEntitySAXFunc (void* ctx, string publicId, string systemId);
1275 // [CCode (cname = "setDocumentLocatorSAXFunc")]
1276 // public static delegate void setDocumentLocatorSAXFunc (void* ctx, SAXLocator loc);
1278 [CCode (cname = "startDocumentSAXFunc")]
1279 public static delegate void startDocumentSAXFunc (void* ctx);
1281 [CCode (cname = "startElementNsSAX2Func")]
1282 public static delegate void startElementNsSAX2Func (void* ctx, string localname, string prefix, string URI, int nb_namespaces, [CCode (array_length = false)] string[] namespaces, int nb_attributes, int nb_defaulted, [CCode (array_length = false)] string[] attributes);
1284 [CCode (cname = "startElementSAXFunc")]
1285 public static delegate void startElementSAXFunc (void* ctx, string name, [CCode (array_length = false)] string[] atts);
1287 [CCode (cname = "unparsedEntityDeclSAXFunc")]
1288 public static delegate void unparsedEntityDeclSAXFunc (void* ctx, string name, string publicId, string systemId, string notationName);
1290 [CCode (cname = "warningSAXFunc")]
1291 public static delegate void warningSAXFunc (void* ctx, string msg, ...);
1293 [CCode (cname ="xmlStructuredErrorFunc")]
1294 public static delegate void xmlStructuredErrorFunc (void* ctx, Error* error);
1297 [CCode (cname = "xmlSAXHandler")]
1298 public struct SAXHandler {
1299 public internalSubsetSAXFunc internalSubset;
1300 public isStandaloneSAXFunc isStandalone;
1301 public hasInternalSubsetSAXFunc hasInternalSubset;
1302 public hasExternalSubsetSAXFunc hasExternalSubset;
1303 // public resolveEntitySAXFunc resolveEntity;
1304 public getEntitySAXFunc getEntity;
1305 public entityDeclSAXFunc entityDecl;
1306 public notationDeclSAXFunc notationDecl;
1307 public attributeDeclSAXFunc attributeDecl;
1308 public elementDeclSAXFunc elementDecl;
1309 public unparsedEntityDeclSAXFunc unparsedEntityDecl;
1310 // public setDocumentLocatorSAXFunc setDocumentLocator;
1311 public startDocumentSAXFunc startDocument;
1312 public endDocumentSAXFunc endDocument;
1313 public startElementSAXFunc startElement;
1314 public endElementSAXFunc endElement;
1315 public referenceSAXFunc reference;
1316 public charactersSAXFunc characters;
1317 public ignorableWhitespaceSAXFunc ignorableWhitespace;
1318 public processingInstructionSAXFunc processingInstruction;
1319 public commentSAXFunc comment;
1320 public warningSAXFunc warning;
1321 public errorSAXFunc error;
1322 public fatalErrorSAXFunc fatalError;
1323 public getParameterEntitySAXFunc getParameterEntity;
1324 public cdataBlockSAXFunc cdataBlock;
1325 public externalSubsetSAXFunc externalSubset;
1326 public uint initialized;
1327 public startElementNsSAX2Func startElementNs;
1328 public endElementNsSAX2Func endElementNs;
1329 public xmlStructuredErrorFunc serror;
1332 [CCode (lower_case_cprefix = "xmlSAX")]
1333 namespace SAXParser {
1334 public int UserParseMemory (SAXHandler* sax, void* user_data, string buffer, int size);
1335 public int UserParseFile (SAXHandler* sax, void* user_data, string filename);
1339 /* xmlerror - error handling */
1342 [CCode (cname = "xmlError", cheader_filename = "libxml/xmlerror.h")]
1343 public struct Error {
1346 public string message;
1347 public ErrorLevel level;
1359 [CCode (cname = "xmlErrorLevel", cprefix = "XML_ERR_", cheader_filename = "libxml/xmlerror.h")]
1360 public enum ErrorLevel {