namespace Xml { /* tree.h */ [CCode (cname = "xmlElementType", cprefix = "XML_", cheader_filename = "libxml/tree.h")] public enum ElementType { ELEMENT_NODE, ATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, ENTITY_REF_NODE, ENTITY_NODE, PI_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, DOCUMENT_FRAG_NODE, NOTATION_NODE, HTML_DOCUMENT_NODE, DTD_NODE, ELEMENT_DECL, ATTRIBUTE_DECL, ENTITY_DECL, NAMESPACE_DECL, XINCLUDE_START, XINCLUDE_END, } [CCode (cname = "xmlAttributeType", cprefix = "XML_ATTRIBUTE_", cheader_filename = "libxml/tree.h")] public enum AttributeType { CDATA, ID, IDREF , IDREFS, ENTITY, ENTITIES, NMTOKEN, NMTOKENS, ENUMERATION, NOTATION } [CCode (free_function = "xmlFreeNs", cname = "xmlNs", cheader_filename = "libxml/tree.h")] public class Ns { public Ns next; public ElementType type; public string href; public string prefix; public pointer _private; public Doc context; } [CCode (free_function = "xmlFreeDtd", cname = "xmlDtd", cheader_filename = "libxml/tree.h")] public class Dtd { public pointer _private; public ElementType type; public string name; public Node children; public Node last; public Node parent; public Node next; public Node prev; public Doc doc; public string ExternalID; public string SystemID; [CCode (cname = "xmlCreateIntSubset")] public Dtd.create_int_subset(Doc doc, string name, string ExternalID, string SystemID); [CCode (cname = "xmlNewDtd")] public Dtd(Doc doc, string name, string ExternalID, string SystemID); [CCode (cname = "xmlCopyDtd")] public Dtd copy(); } [CCode (free_function = "xmlFreeDoc", cname = "xmlDoc", cheader_filename = "libxml/tree.h")] public class Doc { public pointer _private; public ElementType type; public string name; public Node children; public Node last; public Node parent; public Node next; public Node prev; public Doc doc; [CCode (cname = "xmlNewDoc")] public Doc(string version = "1.0"); [CCode (cname = "xmlNewDocProp")] public weak Attr new_prop(string! name, string! value); [CCode (cname = "xmlCopyDoc")] public Doc copy(bool recursive = true); [CCode (cname = "xmlNewDocNode")] public weak Attr new_node(Ns ns, string! name, string content = null); [CCode (cname = "xmlNewDocText")] public weak Node new_text(string content); [CCode (cname = "xmlNewDocComment")] public weak Node new_comment(string content); [CCode (cname = "xmlNewDocTextLen")] public weak Node new_text_len(string content, int len); [CCode (cname = "xmlNewCDataBlock")] public weak Node new_cdata_block(string content, int len); [CCode (cname = "xmlNewCharRef")] public weak Node new_char_ref(string name); [CCode (cname = "xmlNewReference")] public weak Node new_reference(string name); [CCode (cname = "xmlNewDocPI")] public weak Node new_pi(string name, string content); [CCode (cname = "xmlNewDocRawNode")] public weak Node new_raw_node(Ns ns, string name, string content); [CCode (cname = "xmlNewDocFragment")] public weak Node new_fragment(); [CCode (cname = "xmlDocGetRootElement")] public weak Node get_root_element(); [CCode (cname = "xmlDocSetRootElement")] public weak Node set_root_element(Node# root); [CCode (cname = "xmlSetDocCompressMode")] public void set_compress_mode(int mode); [CCode (cname = "xmlGetDocCompressMode")] public int get_compress_mode(); [CCode (cname = "xmlDocDumpMemory")] public void dump_memory(out xmlstring mem, out int len = null); [CCode (cname = "xmlDocDumpFormatMemory")] public void dump_memory_format(out xmlstring mem, out int len = null, bool format = true); [CCode (cname = "xmlDocDumpMemoryEnc")] public void dump_memory_enc(out xmlstring mem, out int len = null, string enc = "UTF-8"); [CCode (cname = "xmlDocDumpFormatMemoryEnc")] public void dump_memory_enc_format(out xmlstring mem, out int len = null, string enc = "UTF-8", bool format = true); [Instance(position = 2)] [CCode (cname = "xmlDocDump")] public int dump(GLib.FileStream f); [Instance(position = 2)] [CCode (cname = "xmlDocFormatDump")] public int dump_format(GLib.FileStream f, bool format = true); [Instance(position = 2)] [CCode (cname = "xmlElemDump")] public void dump_elem(GLib.FileStream f, Node node); [InstanceLast()] [CCode (cname = "xmlSaveFile")] public int save_file(string path); [Instance(position = 2)] [CCode (cname = "xmlSaveFormatFile")] public void save_file_format(string filename, bool format = true); [Instance(position = 2)] [CCode (cname = "xmlSaveFormatFileEnc")] public void save_file_enc_format(string filename, string enc = "UTF-8", bool format = true); [Instance(position = 2)] [CCode (cname = "xmlSaveFileEnc")] public void save_file_enc(string filename, string enc = "UTF-8"); /* XMLPUBFUN int XMLCALL xmlIsXHTML (const xmlChar *systemID, const xmlChar *publicID); XMLPUBFUN int XMLCALL xmlNodeDump (xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, int format); XMLPUBFUN int XMLCALL xmlSaveFileTo (xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding); XMLPUBFUN int XMLCALL xmlSaveFormatFileTo (xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding, int format); XMLPUBFUN void XMLCALL xmlNodeDumpOutput (xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, int format, const char *encoding); */ } [CCode (free_function = "xmlFreeProp", cname = "xmlAttr", cheader_filename = "libxml/tree.h")] public class Attr { public pointer _private; public ElementType type; public string name; public Node children; public Node last; public Node parent; public Node next; public Node prev; public Doc doc; public Ns ns; public AttributeType atype; [CCode (cname = "xmlRemoveProp")] public int remove(); } [CCode (free_function = "xmlFreeNode", cname = "xmlNode", cheader_filename = "libxml/tree.h")] public class Node { public pointer _private; public ElementType type; public string name; public Node children; public Node last; public Node parent; public Node next; public Node prev; public Doc doc; public Ns ns; public string content; public Attr properties; public Ns nsDef; public ushort line; [CCode (cname = "xmlNewNode")] public Node(Ns ns, string! name); [CCode (cname = "xmlNewText")] public Node.text(string content); [CCode (cname = "xmlNewComment")] public Node.comment(string content); [CCode (cname = "xmlNewTextLen")] public Node.text_len(string content, int len); [CCode (cname = "xmlNewPI")] public Node.PI(string name, string content); [CCode (cname = "xmlNewNs")] public weak Ns new_ns(string href, string prefix); [CCode (cname = "xmlNewProp")] public weak Attr new_prop(string name, string value); [CCode (cname = "xmlNewNsProp")] public weak Attr new_ns_prop(Ns ns, string name, string value); [CCode (cname = "xmlNewChild")] public weak Node new_child(Ns ns, string! name, string content = null); [CCode (cname = "xmlNewTextChild")] public weak Node new_text_child(Ns ns, string! name, string content); [CCode (cname = "xmlCopyNode")] public Node copy(bool recursive); [CCode (cname = "xmlDocCopyNode")] public weak Node copy_with_doc(Doc! doc, bool recursive = true); [CCode (cname = "xmlCopyNodeList")] public Node copy_list(); [CCode (cname = "xmlDocCopyNodeList")] public weak Node copy_list_with_doc(Doc! doc); [CCode (cname = "xmlGetLineNo")] public long get_line_no(); [CCode (cname = "xmlGetNodePath")] public xmlstring get_path(); [CCode (cname = "xmlGetLastChild")] public weak Node get_last_child(); [CCode (cname = "xmlNodeIsText")] public bool is_text(); [CCode (cname = "xmlIsBlankNode")] public bool is_blank(); [CCode (cname = "xmlNodeSetName")] public void set_name(string! name); [CCode (cname = "xmlAddChild")] public weak Node add_child(Node! node); [CCode (cname = "xmlAddChildList")] public weak Node add_child_list(Node! node); [CCode (cname = "xmlReplaceNode")] public weak Node replace(Node! new_node); [CCode (cname = "xmlAddPrevSibling")] public weak Node add_prev_sibbling(Node! node); [CCode (cname = "xmlAddSibling")] public weak Node add_sibbling(Node! node); [CCode (cname = "xmlAddNextSibling")] public weak Node add_next_sibbling(Node! node); [CCode (cname = "xmlUnlinkNode")] public void unlink(); [CCode (cname = "xmlTextMerge")] public weak Node text_merge(Node node); [CCode (cname = "xmlTextConcat")] public int text_concat(string content, int len); [CCode (cname = "xmlSetTreeDoc")] public void set_tree_doc(Doc doc); [CCode (cname = "xmlSetListDoc")] public void set_list_doc(Doc doc); /* [Diagnostics] [PrintfLike] [Flags] [ErrorDomain] [Import ()] [InstanceByReference] [InstanceLast ()] [PlusOperator ()] [PrintfFormat] [SimpleType] [ReturnsModifiedPointer ()] [IntegerType (rank = 1)] [FloatingType (rank = 1)] [NoArrayLength] [NoAccessorMethod] [HasEmitter] */ /* NS void XMLCALL xmlFreeNodeList (xmlNodePtr cur); XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNs (xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace); XMLPUBFUN xmlNsPtr XMLCALL xmlSearchNsByHref (xmlDocPtr doc, xmlNodePtr node, const xmlChar *href); XMLPUBFUN xmlNsPtr * XMLCALL xmlGetNsList (xmlDocPtr doc, xmlNodePtr node); XMLPUBFUN void XMLCALL xmlSetNs (xmlNodePtr node, xmlNsPtr ns); XMLPUBFUN xmlNsPtr XMLCALL xmlCopyNamespace (xmlNsPtr cur); XMLPUBFUN xmlNsPtr XMLCALL xmlCopyNamespaceList (xmlNsPtr cur); */ [CCode (cname = "xmlSetProp")] public weak Attr set_prop(string! name, string value); [CCode (cname = "xmlSetNsProp")] public weak Attr set_ns_prop(Ns ns, string! name, string value); [CCode (cname = "xmlGetNoNsProp")] public xmlstring get_no_ns_prop(string! name); [CCode (cname = "xmlGetProp")] public xmlstring get_prop(string! name); [CCode (cname = "xmlHasProp")] public weak Attr has_prop(string! name); [CCode (cname = "xmlHasNsProp")] public weak Attr has_ns_prop(string! name, string! ns); [CCode (cname = "xmlGetNsProp")] public xmlstring get_ns_prop(string! name, string! ns); [CCode (cname = "xmlUnsetProp")] public bool unset_prop(string name); [CCode (cname = "xmlUnsetNsProp")] public bool unset_ns_prop(Ns ns, string name); [CCode (cname = "xmlNodeSetContent")] public void set_content(string content); [CCode (cname = "xmlNodeSetContentLen")] public void set_content_len(string content, int len); [CCode (cname = "xmlNodeAddContent")] public void add_content(string content); [CCode (cname = "xmlNodeAddContentLen")] public void add_content_len(string content, int len); [CCode (cname = "xmlNodeGetContent")] public xmlstring get_content(); /* XMLPUBFUN xmlNodePtr XMLCALL xmlStringGetNodeList (xmlDocPtr doc, const xmlChar *value); XMLPUBFUN xmlNodePtr XMLCALL xmlStringLenGetNodeList (xmlDocPtr doc, const xmlChar *value, int len); XMLPUBFUN xmlChar * XMLCALL xmlNodeListGetString (xmlDocPtr doc, xmlNodePtr list, int inLine); XMLPUBFUN xmlChar * XMLCALL xmlNodeListGetRawString (xmlDocPtr doc, xmlNodePtr list, int inLine); XMLPUBFUN int XMLCALL xmlNodeBufGetContent (xmlBufferPtr buffer, xmlNodePtr cur); XMLPUBFUN int XMLCALL xmlNodeGetSpacePreserve (xmlNodePtr cur); XMLPUBFUN void XMLCALL xmlNodeSetSpacePreserve (xmlNodePtr cur, int val); XMLPUBFUN xmlChar * XMLCALL xmlNodeGetLang (xmlNodePtr cur); XMLPUBFUN void XMLCALL xmlNodeSetLang (xmlNodePtr cur, const xmlChar *lang); XMLPUBFUN xmlChar * XMLCALL xmlNodeGetBase (xmlDocPtr doc, xmlNodePtr cur); XMLPUBFUN void XMLCALL xmlNodeSetBase (xmlNodePtr cur, const xmlChar *uri); */ } [CCode (cname = "xmlSetCompressMode")] public void set_compress_mode(int mode); [CCode (cname = "xmlGetCompressMode")] public int get_compress_mode(); [SimpleType] [CCode (cname = "xmlChar", const_cname = "const char", copy_function = "xmlStrdup", free_function = "xmlFree" )] public class xmlstring : string { } }