Module: LibXML::XML
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Classes:
Attr ,
AttrDecl ,
Attributes ,
Document ,
Dtd ,
HTMLParser ,
InputCallbacks ,
Namespace ,
Namespaces ,
Node ,
Parser ,
Reader ,
RelaxNG ,
SaxParser ,
Schema ,
Tree ,
Writer ,
XInclude | |
Exceptions:
| |
Defined in: | ext/libxml/ruby_xml.c, lib/libxml/attr.rb, lib/libxml/attr_decl.rb, lib/libxml/attributes.rb, lib/libxml/document.rb, lib/libxml/error.rb, lib/libxml/html_parser.rb, lib/libxml/namespace.rb, lib/libxml/namespaces.rb, lib/libxml/node.rb, lib/libxml/parser.rb, lib/libxml/sax_callbacks.rb, lib/libxml/sax_parser.rb, lib/libxml/schema.rb, lib/libxml/tree.rb, lib/libxml/schema/attribute.rb, lib/libxml/schema/element.rb, lib/libxml/schema/type.rb |
Overview
The libxml gem provides Ruby language bindings for GNOME’s Libxml2 XML
toolkit. Refer to the README file to get started and the LICENSE file for copyright and distribution information.
Constant Summary
-
LIBXML_VERSION =
Constants
rb_str_new2(LIBXML_DOTTED_VERSION)
-
VERNUM =
# File 'ext/libxml/ruby_xml.c', line 521INT2NUM(RUBY_LIBXML_VERNUM)
-
VERSION =
# File 'ext/libxml/ruby_xml.c', line 520rb_str_new2(RUBY_LIBXML_VERSION)
-
XML_NAMESPACE =
# File 'ext/libxml/ruby_xml.c', line 522rb_str_new2((const char*) XML_XML_NAMESPACE)
Class Attribute Summary
-
.default_compression ⇒ Boolean
rw
mod_func
Determine whether parsers use Zlib compression by default (requires libxml to be compiled with Zlib support).
-
.default_compression=(true|false)
rw
mod_func
Controls whether parsers use Zlib compression by default (requires libxml to be compiled with Zlib support).
-
.default_save_no_empty_tags ⇒ Boolean
rw
mod_func
Determine whether serializer outputs empty tags by default.
-
.default_save_no_empty_tags=(true|false)
rw
mod_func
Controls whether serializer outputs empty tags by default.
-
.default_tree_indent_string ⇒ "string"
rw
mod_func
Obtain the default string used by parsers to indent the
XML
tree for output. -
.default_tree_indent_string=("string")
rw
mod_func
Set the default string used by parsers to indent the
XML
tree for output. -
.enabled_automata? ⇒ Boolean
readonly
mod_func
Determine whether libxml regexp automata support is enabled.
-
.enabled_c14n? ⇒ Boolean
readonly
mod_func
Determine whether libxml ‘canonical XML’ support is enabled.
-
.enabled_catalog? ⇒ Boolean
readonly
mod_func
Determine whether libxml resource catalog support is enabled.
-
.enabled_debug? ⇒ Boolean
readonly
mod_func
Determine whether libxml debugging support is enabled.
-
.enabled_docbook? ⇒ Boolean
readonly
mod_func
Determine whether libxml docbook support is enabled.
-
.enabled_ftp? ⇒ Boolean
readonly
mod_func
Determine whether libxml ftp client support is enabled.
-
.enabled_html? ⇒ Boolean
readonly
mod_func
Determine whether libxml html support is enabled.
-
.enabled_http? ⇒ Boolean
readonly
mod_func
Determine whether libxml http client support is enabled.
-
.enabled_iconv? ⇒ Boolean
readonly
mod_func
Determine whether libxml iconv support is enabled.
-
.enabled_memory_debug? ⇒ Boolean
readonly
mod_func
Determine whether libxml memory location debugging support is enabled.
-
.enabled_regexp? ⇒ Boolean
readonly
mod_func
Determine whether libxml regular expression support is enabled.
-
.enabled_schemas? ⇒ Boolean
readonly
mod_func
Determine whether libxml schema support is enabled.
-
.enabled_thread? ⇒ Boolean
readonly
mod_func
Determine whether thread-safe semantics support for libxml is enabled and is used by this ruby extension.
-
.enabled_unicode? ⇒ Boolean
readonly
mod_func
Determine whether libxml unicode support is enabled.
-
.enabled_xinclude? ⇒ Boolean
readonly
mod_func
Determine whether libxml xinclude support is enabled.
-
.enabled_xpath? ⇒ Boolean
readonly
mod_func
Determine whether libxml xpath support is enabled.
-
.enabled_xpointer? ⇒ Boolean
readonly
mod_func
Determine whether libxml xpointer support is enabled.
-
.enabled_zlib? ⇒ Boolean
readonly
mod_func
Determine whether libxml zlib support is enabled.
-
.indent_tree_output ⇒ Boolean
rw
mod_func
Determines whether
XML
output will be indented (using the string supplied todefault_indent_tree_string
). -
.indent_tree_output=(true|false)
rw
mod_func
Controls whether
XML
output will be indented (using the string supplied todefault_indent_tree_string
).
Class Method Summary
-
.catalog_dump ⇒ true
mod_func
Dump all the global catalog content stdout.
-
.catalog_remove(catalog) ⇒ true
mod_func
Remove the specified resource catalog.
-
.check_lib_versions ⇒ true
mod_func
Check LIBXML version matches version the bindings were compiled to.
-
.memory_dump ⇒ Boolean
mod_func
Perform a parser memory dump (requires memory debugging support in libxml).
-
.memory_used ⇒ num_bytes
mod_func
Perform a parser memory dump (requires memory debugging support in libxml).
Class Attribute Details
.default_compression ⇒ Boolean
(rw, mod_func)
Determine whether parsers use Zlib compression by default (requires libxml to be compiled with Zlib support).
# File 'ext/libxml/ruby_xml.c', line 367
static VALUE rxml_default_compression_get(VALUE klass) { #ifdef HAVE_ZLIB_H return(INT2FIX(xmlGetCompressMode())); #else rb_warn("libxml was compiled without zlib support"); return (Qfalse); #endif }
.default_compression=(true|false) (rw, mod_func)
Controls whether parsers use Zlib compression by default (requires libxml to be compiled with Zlib support).
# File 'ext/libxml/ruby_xml.c', line 384
static VALUE rxml_default_compression_set(VALUE klass, VALUE num) { #ifdef HAVE_ZLIB_H Check_Type(num, T_FIXNUM); xmlSetCompressMode(FIX2INT(num)); return(num); #else rb_warn("libxml was compiled without zlib support"); return (Qfalse); #endif }
.default_save_no_empty_tags ⇒ Boolean
(rw, mod_func)
Determine whether serializer outputs empty tags by default.
# File 'ext/libxml/ruby_xml.c', line 402
static VALUE rxml_default_save_no_empty_tags_get(VALUE klass) { if (xmlSaveNoEmptyTags) return (Qtrue); else return (Qfalse); }
.default_save_no_empty_tags=(true|false) (rw, mod_func)
Controls whether serializer outputs empty tags by default.
# File 'ext/libxml/ruby_xml.c', line 416
static VALUE rxml_default_save_no_empty_tags_set(VALUE klass, VALUE value) { if (value == Qfalse) { xmlSaveNoEmptyTags = 0; return (Qfalse); } else if (value == Qtrue) { xmlSaveNoEmptyTags = 1; return (Qtrue); } else { rb_raise(rb_eArgError, "Invalid argument, must be a boolean"); } }
.default_tree_indent_string ⇒ "string
" (rw, mod_func)
Obtain the default string used by parsers to indent the XML
tree for output.
# File 'ext/libxml/ruby_xml.c', line 338
static VALUE rxml_default_tree_indent_string_get(VALUE klass) { if (xmlTreeIndentString == NULL) return (Qnil); else return (rb_str_new2(xmlTreeIndentString)); }
.default_tree_indent_string=("string") (rw, mod_func)
Set the default string used by parsers to indent the XML
tree for output.
# File 'ext/libxml/ruby_xml.c', line 353
static VALUE rxml_default_tree_indent_string_set(VALUE klass, VALUE string) { Check_Type(string, T_STRING); xmlTreeIndentString = (const char *)xmlStrdup((xmlChar *)StringValuePtr(string)); return (string); }
.enabled_automata? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml regexp automata support is enabled.
# File 'ext/libxml/ruby_xml.c', line 52
static VALUE rxml_enabled_automata_q(VALUE klass) { #ifdef LIBXML_AUTOMATA_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_c14n? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml ‘canonical XML’ support is enabled. See “Canonical XML” (www.w3.org/TR/xml-c14n)
# File 'ext/libxml/ruby_xml.c', line 68
static VALUE rxml_enabled_c14n_q(VALUE klass) { #ifdef LIBXML_C14N_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_catalog? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml resource catalog support is enabled.
# File 'ext/libxml/ruby_xml.c', line 83
static VALUE rxml_enabled_catalog_q(VALUE klass) { #ifdef LIBXML_CATALOG_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_debug? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml debugging support is enabled.
# File 'ext/libxml/ruby_xml.c', line 98
static VALUE rxml_enabled_debug_q(VALUE klass) { #ifdef LIBXML_DEBUG_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_docbook? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml docbook support is enabled.
# File 'ext/libxml/ruby_xml.c', line 113
static VALUE rxml_enabled_docbook_q(VALUE klass) { #ifdef LIBXML_DOCB_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_ftp? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml ftp client support is enabled.
# File 'ext/libxml/ruby_xml.c', line 128
static VALUE rxml_enabled_ftp_q(VALUE klass) { #ifdef LIBXML_FTP_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_html? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml html support is enabled.
# File 'ext/libxml/ruby_xml.c', line 158
static VALUE rxml_enabled_html_q(VALUE klass) { #ifdef LIBXML_HTML_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_http? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml http client support is enabled.
# File 'ext/libxml/ruby_xml.c', line 143
static VALUE rxml_enabled_http_q(VALUE klass) { #ifdef LIBXML_HTTP_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_iconv? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml iconv support is enabled.
# File 'ext/libxml/ruby_xml.c', line 173
static VALUE rxml_enabled_iconv_q(VALUE klass) { #ifdef LIBXML_ICONV_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_memory_debug? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml memory location debugging support is enabled.
# File 'ext/libxml/ruby_xml.c', line 189
static VALUE rxml_enabled_memory_debug_location_q(VALUE klass) { #ifdef DEBUG_MEMORY_LOCATION return(Qtrue); #else return (Qfalse); #endif }
.enabled_regexp? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml regular expression support is enabled.
# File 'ext/libxml/ruby_xml.c', line 204
static VALUE rxml_enabled_regexp_q(VALUE klass) { #ifdef LIBXML_REGEXP_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_schemas? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml schema support is enabled.
# File 'ext/libxml/ruby_xml.c', line 219
static VALUE rxml_enabled_schemas_q(VALUE klass) { #ifdef LIBXML_SCHEMAS_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_thread? ⇒ Boolean
(readonly, mod_func)
Determine whether thread-safe semantics support for libxml is enabled and is used by this ruby extension. Threading support in libxml uses pthread on Unix-like systems and Win32 threads on Windows.
# File 'ext/libxml/ruby_xml.c', line 236
static VALUE rxml_enabled_thread_q(VALUE klass) { /* This won't be defined unless this code is compiled with _REENTRANT or __MT__ * defined or the compiler is in C99 mode. * * Note the relevant portion libxml/xmlversion.h on a thread-enabled build: * * #if defined(_REENTRANT) || defined(__MT__) || \ * (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE - 0 >= 199506L)) * #define LIBXML_THREAD_ENABLED * #endif * */ #ifdef LIBXML_THREAD_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_unicode? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml unicode support is enabled.
# File 'ext/libxml/ruby_xml.c', line 262
static VALUE rxml_enabled_unicode_q(VALUE klass) { #ifdef LIBXML_UNICODE_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_xinclude? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml xinclude support is enabled.
# File 'ext/libxml/ruby_xml.c', line 277
static VALUE rxml_enabled_xinclude_q(VALUE klass) { #ifdef LIBXML_XINCLUDE_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_xpath? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml xpath support is enabled.
# File 'ext/libxml/ruby_xml.c', line 292
static VALUE rxml_enabled_xpath_q(VALUE klass) { #ifdef LIBXML_XPATH_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_xpointer? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml xpointer support is enabled.
# File 'ext/libxml/ruby_xml.c', line 307
static VALUE rxml_enabled_xpointer_q(VALUE klass) { #ifdef LIBXML_XPTR_ENABLED return(Qtrue); #else return (Qfalse); #endif }
.enabled_zlib? ⇒ Boolean
(readonly, mod_func)
Determine whether libxml zlib support is enabled.
# File 'ext/libxml/ruby_xml.c', line 322
static VALUE rxml_enabled_zlib_q(VALUE klass) { #ifdef HAVE_ZLIB_H return(Qtrue); #else return (Qfalse); #endif }
.indent_tree_output ⇒ Boolean
(rw, mod_func)
Determines whether XML
output will be indented (using the string supplied to default_indent_tree_string
)
# File 'ext/libxml/ruby_xml.c', line 441
static VALUE rxml_indent_tree_output_get(VALUE klass) { if (xmlIndentTreeOutput) return (Qtrue); else return (Qfalse); }
.indent_tree_output=(true|false) (rw, mod_func)
Controls whether XML
output will be indented (using the string supplied to default_indent_tree_string
)
# File 'ext/libxml/ruby_xml.c', line 456
static VALUE rxml_indent_tree_output_set(VALUE klass, VALUE value) { if (value == Qtrue) { xmlIndentTreeOutput = 1; return (Qtrue); } else if (value == Qfalse) { xmlIndentTreeOutput = 0; return (Qfalse); } else { rb_raise(rb_eArgError, "Invalid argument, must be boolean"); } }
Class Method Details
.catalog_dump ⇒ true
(mod_func)
Dump all the global catalog content stdout.
# File 'ext/libxml/ruby_xml.c', line 14
static VALUE rxml_catalog_dump(VALUE self) { xmlCatalogDump(stdout); return (Qtrue); }
.catalog_remove(catalog) ⇒ true
(mod_func)
Remove the specified resource catalog.
# File 'ext/libxml/ruby_xml.c', line 26
static VALUE rxml_catalog_remove(VALUE self, VALUE cat) { Check_Type(cat, T_STRING); xmlCatalogRemove((xmlChar *) StringValuePtr(cat)); return (Qtrue); }
.check_lib_versions ⇒ true
(mod_func)
Check LIBXML version matches version the bindings were compiled to. Throws an exception if not.
# File 'ext/libxml/ruby_xml.c', line 40
static VALUE rxml_check_lib_versions(VALUE klass) { xmlCheckVersion(LIBXML_VERSION); return (Qtrue); }
.memory_dump ⇒ Boolean
(mod_func)
Perform a parser memory dump (requires memory debugging support in libxml).
# File 'ext/libxml/ruby_xml.c', line 481
static VALUE rxml_memory_dump(VALUE self) { #ifdef DEBUG_MEMORY_LOCATION xmlMemoryDump(); return(Qtrue); #else rb_warn("libxml was compiled without memory debugging support"); return (Qfalse); #endif }
.memory_used ⇒ num_bytes
(mod_func)
Perform a parser memory dump (requires memory debugging support in libxml).
# File 'ext/libxml/ruby_xml.c', line 499
static VALUE rxml_memory_used(VALUE self) { #ifdef DEBUG_MEMORY_LOCATION return(INT2NUM(xmlMemUsed())); #else rb_warn("libxml was compiled without memory debugging support"); return (Qfalse); #endif }