Module LibXML::XML

  1. ext/libxml/libxml.c
  2. lib/libxml/attr.rb
  3. lib/libxml/attributes.rb
  4. lib/libxml/attr_decl.rb
  5. lib/libxml/document.rb
  6. lib/libxml/error.rb
  7. lib/libxml/html_parser.rb
  8. lib/libxml/namespace.rb
  9. lib/libxml/namespaces.rb
  10. lib/libxml/node.rb
  11. lib/libxml/ns.rb
  12. lib/libxml/parser.rb
  13. lib/libxml/properties.rb
  14. lib/libxml/reader.rb
  15. lib/libxml/sax_callbacks.rb
  16. lib/libxml/sax_parser.rb
  17. lib/libxml/tree.rb
  18. lib/libxml/xpath_object.rb
  19. show all

Methods

public class

  1. catalog_dump
  2. catalog_dump
  3. catalog_remove
  4. catalog_remove
  5. check_lib_versions
  6. check_lib_versions
  7. debug_entities
  8. debug_entities
  9. debug_entities=
  10. debug_entities=
  11. default_compression
  12. default_compression
  13. default_compression=
  14. default_compression=
  15. default_keep_blanks
  16. default_keep_blanks
  17. default_keep_blanks=
  18. default_keep_blanks=
  19. default_line_numbers
  20. default_line_numbers
  21. default_line_numbers=
  22. default_line_numbers=
  23. default_load_external_dtd
  24. default_load_external_dtd
  25. default_load_external_dtd=
  26. default_load_external_dtd=
  27. default_options
  28. default_options
  29. default_pedantic_parser
  30. default_pedantic_parser
  31. default_pedantic_parser=
  32. default_pedantic_parser=
  33. default_substitute_entities
  34. default_substitute_entities
  35. default_substitute_entities=
  36. default_substitute_entities=
  37. default_tree_indent_string
  38. default_tree_indent_string
  39. default_tree_indent_string=
  40. default_tree_indent_string=
  41. default_validity_checking
  42. default_validity_checking
  43. default_validity_checking=
  44. default_validity_checking=
  45. default_warnings
  46. default_warnings
  47. default_warnings=
  48. default_warnings=
  49. enabled_automata?
  50. enabled_automata?
  51. enabled_c14n?
  52. enabled_c14n?
  53. enabled_catalog?
  54. enabled_catalog?
  55. enabled_debug?
  56. enabled_debug?
  57. enabled_docbook?
  58. enabled_docbook?
  59. enabled_ftp?
  60. enabled_ftp?
  61. enabled_html?
  62. enabled_html?
  63. enabled_http?
  64. enabled_http?
  65. enabled_iconv?
  66. enabled_iconv?
  67. enabled_memory_debug?
  68. enabled_memory_debug?
  69. enabled_regexp?
  70. enabled_regexp?
  71. enabled_schemas?
  72. enabled_schemas?
  73. enabled_thread?
  74. enabled_thread?
  75. enabled_unicode?
  76. enabled_unicode?
  77. enabled_xinclude?
  78. enabled_xinclude?
  79. enabled_xpath?
  80. enabled_xpath?
  81. enabled_xpointer?
  82. enabled_xpointer?
  83. enabled_zlib?
  84. enabled_zlib?
  85. features
  86. features
  87. indent_tree_output
  88. indent_tree_output
  89. indent_tree_output=
  90. indent_tree_output=
  91. memory_dump
  92. memory_dump
  93. memory_used
  94. memory_used

Constants

LIBXML_VERSION = rb_str_new2(LIBXML_DOTTED_VERSION)   Constants
VERSION = rb_str_new2(RUBY_LIBXML_VERSION)
VERNUM = INT2NUM(RUBY_LIBXML_VERNUM)
XML_NAMESPACE = rb_str_new2((const char*) XML_XML_NAMESPACE)
LIBXML_VERSION = rb_str_new2(LIBXML_DOTTED_VERSION)   Constants
VERSION = rb_str_new2(RUBY_LIBXML_VERSION)
VERNUM = INT2NUM(RUBY_LIBXML_VERNUM)
XML_NAMESPACE = rb_str_new2((const char*) XML_XML_NAMESPACE)

Public class methods

XML.catalog_dump → true

Dump all the global catalog content stdout.

[show source]
static VALUE rxml_catalog_dump(VALUE self)
{
  xmlCatalogDump(stdout);
  return (Qtrue);
}
XML.catalog_dump → true

Dump all the global catalog content stdout.

[show source]
static VALUE rxml_catalog_dump(VALUE self)
{
  xmlCatalogDump(stdout);
  return (Qtrue);
}
XML.catalog_remove(catalog) → true

Remove the specified resource catalog.

[show source]
static VALUE rxml_catalog_remove(VALUE self, VALUE cat)
{
  Check_Type(cat, T_STRING);
  xmlCatalogRemove((xmlChar *) StringValuePtr(cat));
  return (Qtrue);
}
XML.catalog_remove(catalog) → true

Remove the specified resource catalog.

[show source]
static VALUE rxml_catalog_remove(VALUE self, VALUE cat)
{
  Check_Type(cat, T_STRING);
  xmlCatalogRemove((xmlChar *) StringValuePtr(cat));
  return (Qtrue);
}
XML.check_lib_versions → true

Check LIBXML version matches version the bindings were compiled to. Throws an exception if not.

[show source]
static VALUE rxml_check_lib_versions(VALUE klass)
{
  xmlCheckVersion(LIBXML_VERSION);
  return (Qtrue);
}
XML.check_lib_versions → true

Check LIBXML version matches version the bindings were compiled to. Throws an exception if not.

[show source]
static VALUE rxml_check_lib_versions(VALUE klass)
{
  xmlCheckVersion(LIBXML_VERSION);
  return (Qtrue);
}
XML.debug_entities → (true|false)

Determine whether included-entity debugging is enabled. (Requires Libxml to be compiled with debugging support)

[show source]
static VALUE rxml_debug_entities_get(VALUE klass)
{
#ifdef LIBXML_DEBUG_ENABLED
  if (xmlParserDebugEntities)
  return(Qtrue);
  else
  return(Qfalse);
#else
  rb_warn("libxml was compiled with debugging turned off");
  return (Qfalse);
#endif
}
XML.debug_entities → (true|false)

Determine whether included-entity debugging is enabled. (Requires Libxml to be compiled with debugging support)

[show source]
static VALUE rxml_debug_entities_get(VALUE klass)
{
#ifdef LIBXML_DEBUG_ENABLED
  if (xmlParserDebugEntities)
  return(Qtrue);
  else
  return(Qfalse);
#else
  rb_warn("libxml was compiled with debugging turned off");
  return (Qfalse);
#endif
}
XML.debug_entities = true|false

Enable or disable included-entity debugging. (Requires Libxml to be compiled with debugging support)

[show source]
static VALUE rxml_debug_entities_set(VALUE klass, VALUE bool)
{
#ifdef LIBXML_DEBUG_ENABLED
  if (TYPE(bool) == T_FALSE)
  {
    xmlParserDebugEntities = 0;
    return(Qfalse);
  }
  else
  {
    xmlParserDebugEntities = 1;
    return(Qtrue);
  }
#else
  rb_warn("libxml was compiled with debugging turned off");
#endif
}
XML.debug_entities = true|false

Enable or disable included-entity debugging. (Requires Libxml to be compiled with debugging support)

[show source]
static VALUE rxml_debug_entities_set(VALUE klass, VALUE bool)
{
#ifdef LIBXML_DEBUG_ENABLED
  if (TYPE(bool) == T_FALSE)
  {
    xmlParserDebugEntities = 0;
    return(Qfalse);
  }
  else
  {
    xmlParserDebugEntities = 1;
    return(Qtrue);
  }
#else
  rb_warn("libxml was compiled with debugging turned off");
#endif
}
XML.default_compression → (true|false)

Determine whether parsers use Zlib compression by default (requires libxml to be compiled with Zlib support).

[show source]
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
}
XML.default_compression → (true|false)

Determine whether parsers use Zlib compression by default (requires libxml to be compiled with Zlib support).

[show source]
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
}
XML.default_compression = true|false

Controls whether parsers use Zlib compression by default (requires libxml to be compiled with Zlib support).

[show source]
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
}
XML.default_compression = true|false

Controls whether parsers use Zlib compression by default (requires libxml to be compiled with Zlib support).

[show source]
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
}
XML.default_keep_blanks → (true|false)

Determine whether parsers retain whitespace by default.

[show source]
static VALUE rxml_default_keep_blanks_get(VALUE klass)
{
  if (xmlKeepBlanksDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_keep_blanks → (true|false)

Determine whether parsers retain whitespace by default.

[show source]
static VALUE rxml_default_keep_blanks_get(VALUE klass)
{
  if (xmlKeepBlanksDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_keep_blanks = true|false

Controls whether parsers retain whitespace by default.

[show source]
static VALUE rxml_default_keep_blanks_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_FALSE)
  {
    xmlKeepBlanksDefaultValue = 0;
    return (Qfalse);
  }
  else if (TYPE(bool) == T_TRUE)
  {
    xmlKeepBlanksDefaultValue = 1;
    return (Qtrue);
  }
  else
  {
    rb_raise(rb_eArgError, "Invalid argument, must be a boolean");
  }
}
XML.default_keep_blanks = true|false

Controls whether parsers retain whitespace by default.

[show source]
static VALUE rxml_default_keep_blanks_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_FALSE)
  {
    xmlKeepBlanksDefaultValue = 0;
    return (Qfalse);
  }
  else if (TYPE(bool) == T_TRUE)
  {
    xmlKeepBlanksDefaultValue = 1;
    return (Qtrue);
  }
  else
  {
    rb_raise(rb_eArgError, "Invalid argument, must be a boolean");
  }
}
XML.default_line_numbers → (true|false)

Determine whether parsers retain line-numbers by default.

[show source]
static VALUE rxml_default_line_numbers_get(VALUE klass)
{
  if (xmlLineNumbersDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_line_numbers → (true|false)

Determine whether parsers retain line-numbers by default.

[show source]
static VALUE rxml_default_line_numbers_get(VALUE klass)
{
  if (xmlLineNumbersDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_line_numbers = true|false

Controls whether parsers retain line-numbers by default.

[show source]
static VALUE rxml_default_line_numbers_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_FALSE)
  {
    xmlLineNumbersDefault(0);
    return (Qfalse);
  }
  else
  {
    xmlLineNumbersDefault(1);
    return (Qtrue);
  }
}
XML.default_line_numbers = true|false

Controls whether parsers retain line-numbers by default.

[show source]
static VALUE rxml_default_line_numbers_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_FALSE)
  {
    xmlLineNumbersDefault(0);
    return (Qfalse);
  }
  else
  {
    xmlLineNumbersDefault(1);
    return (Qtrue);
  }
}
XML.default_load_external_dtd → (true|false)

Determine whether parsers load external DTDs by default.

[show source]
static VALUE rxml_default_load_external_dtd_get(VALUE klass)
{
  if (xmlLoadExtDtdDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_load_external_dtd → (true|false)

Determine whether parsers load external DTDs by default.

[show source]
static VALUE rxml_default_load_external_dtd_get(VALUE klass)
{
  if (xmlLoadExtDtdDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_load_external_dtd = true|false

Controls whether parsers load external DTDs by default.

[show source]
static VALUE rxml_default_load_external_dtd_set(VALUE klass, VALUE bool)
{
  if (bool == Qfalse)
  {
    xmlLoadExtDtdDefaultValue = 0;
    return (Qfalse);
  }
  else
  {
    xmlLoadExtDtdDefaultValue = 1;
    return (Qtrue);
  }
}
XML.default_load_external_dtd = true|false

Controls whether parsers load external DTDs by default.

[show source]
static VALUE rxml_default_load_external_dtd_set(VALUE klass, VALUE bool)
{
  if (bool == Qfalse)
  {
    xmlLoadExtDtdDefaultValue = 0;
    return (Qfalse);
  }
  else
  {
    xmlLoadExtDtdDefaultValue = 1;
    return (Qtrue);
  }
}
XML.default_options → int

Returns an integer that summarize libxml2’s default options.

[show source]
static VALUE rxml_default_options_get(VALUE klass)
{
  int options = rxml_libxml_default_options();
  return INT2NUM(options);
}
XML.default_options → int

Returns an integer that summarize libxml2’s default options.

[show source]
static VALUE rxml_default_options_get(VALUE klass)
{
  int options = rxml_libxml_default_options();
  return INT2NUM(options);
}
XML.default_pedantic_parser → (true|false)

Determine whether parsers are pedantic by default.

[show source]
static VALUE rxml_default_pedantic_parser_get(VALUE klass)
{
  if (xmlPedanticParserDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_pedantic_parser → (true|false)

Determine whether parsers are pedantic by default.

[show source]
static VALUE rxml_default_pedantic_parser_get(VALUE klass)
{
  if (xmlPedanticParserDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_pedantic_parser = true|false

Controls whether parsers are pedantic by default.

[show source]
static VALUE rxml_default_pedantic_parser_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_FALSE)
  {
    xmlPedanticParserDefault(0);
    return (Qfalse);
  }
  else
  {
    xmlPedanticParserDefault(1);
    return (Qtrue);
  }
}
XML.default_pedantic_parser = true|false

Controls whether parsers are pedantic by default.

[show source]
static VALUE rxml_default_pedantic_parser_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_FALSE)
  {
    xmlPedanticParserDefault(0);
    return (Qfalse);
  }
  else
  {
    xmlPedanticParserDefault(1);
    return (Qtrue);
  }
}
XML.default_substitute_entities → (true|false)

Determine whether parsers perform inline entity substitution (for external entities) by default.

[show source]
static VALUE rxml_default_substitute_entities_get(VALUE klass)
{
  if (xmlSubstituteEntitiesDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_substitute_entities → (true|false)

Determine whether parsers perform inline entity substitution (for external entities) by default.

[show source]
static VALUE rxml_default_substitute_entities_get(VALUE klass)
{
  if (xmlSubstituteEntitiesDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_substitute_entities = true|false

Controls whether parsers perform inline entity substitution (for external entities) by default.

[show source]
static VALUE rxml_default_substitute_entities_set(VALUE klass, VALUE bool)
{
  if (bool == Qfalse)
  {
    xmlSubstituteEntitiesDefault(0);
    return (Qfalse);
  }
  else
  {
    xmlSubstituteEntitiesDefault(1);
    return (Qtrue);
  }
}
XML.default_substitute_entities = true|false

Controls whether parsers perform inline entity substitution (for external entities) by default.

[show source]
static VALUE rxml_default_substitute_entities_set(VALUE klass, VALUE bool)
{
  if (bool == Qfalse)
  {
    xmlSubstituteEntitiesDefault(0);
    return (Qfalse);
  }
  else
  {
    xmlSubstituteEntitiesDefault(1);
    return (Qtrue);
  }
}
XML.default_tree_indent_string → "string"

Obtain the default string used by parsers to indent the XML tree for output.

[show source]
static VALUE rxml_default_tree_indent_string_get(VALUE klass)
{
  if (xmlTreeIndentString == NULL)
    return (Qnil);
  else
    return (rb_str_new2(xmlTreeIndentString));
}
XML.default_tree_indent_string → "string"

Obtain the default string used by parsers to indent the XML tree for output.

[show source]
static VALUE rxml_default_tree_indent_string_get(VALUE klass)
{
  if (xmlTreeIndentString == NULL)
    return (Qnil);
  else
    return (rb_str_new2(xmlTreeIndentString));
}
XML.default_tree_indent_string = "string"

Set the default string used by parsers to indent the XML tree for output.

[show source]
static VALUE rxml_default_tree_indent_string_set(VALUE klass, VALUE string)
{
  Check_Type(string, T_STRING);
  xmlTreeIndentString = xmlStrdup((xmlChar *)StringValuePtr(string));
  return (string);
}
XML.default_tree_indent_string = "string"

Set the default string used by parsers to indent the XML tree for output.

[show source]
static VALUE rxml_default_tree_indent_string_set(VALUE klass, VALUE string)
{
  Check_Type(string, T_STRING);
  xmlTreeIndentString = xmlStrdup((xmlChar *)StringValuePtr(string));
  return (string);
}
XML.default_validity_checking → (true|false)

Determine whether parsers perform XML validation by default.

[show source]
static VALUE rxml_default_validity_checking_get(VALUE klass)
{
  if (xmlDoValidityCheckingDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_validity_checking → (true|false)

Determine whether parsers perform XML validation by default.

[show source]
static VALUE rxml_default_validity_checking_get(VALUE klass)
{
  if (xmlDoValidityCheckingDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_validity_checking = true|false

Controls whether parsers perform XML validation by default.

[show source]
static VALUE rxml_default_validity_checking_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_FALSE)
  {
    xmlDoValidityCheckingDefaultValue = 0;
    return (Qfalse);
  }
  else
  {
    xmlDoValidityCheckingDefaultValue = 1;
    return (Qtrue);
  }
}
XML.default_validity_checking = true|false

Controls whether parsers perform XML validation by default.

[show source]
static VALUE rxml_default_validity_checking_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_FALSE)
  {
    xmlDoValidityCheckingDefaultValue = 0;
    return (Qfalse);
  }
  else
  {
    xmlDoValidityCheckingDefaultValue = 1;
    return (Qtrue);
  }
}
XML.default_warnings → (true|false)

Determine whether parsers output warnings by default.

[show source]
static VALUE rxml_default_warnings_get(VALUE klass)
{
  if (xmlGetWarningsDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_warnings → (true|false)

Determine whether parsers output warnings by default.

[show source]
static VALUE rxml_default_warnings_get(VALUE klass)
{
  if (xmlGetWarningsDefaultValue)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.default_warnings = true|false

Controls whether parsers output warnings by default.

[show source]
static VALUE rxml_default_warnings_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_FALSE)
  {
    xmlGetWarningsDefaultValue = 0;
    return (Qfalse);
  }
  else
  {
    xmlGetWarningsDefaultValue = 1;
    return (Qtrue);
  }
}
XML.default_warnings = true|false

Controls whether parsers output warnings by default.

[show source]
static VALUE rxml_default_warnings_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_FALSE)
  {
    xmlGetWarningsDefaultValue = 0;
    return (Qfalse);
  }
  else
  {
    xmlGetWarningsDefaultValue = 1;
    return (Qtrue);
  }
}
XML.enabled_automata? → (true|false)

Determine whether libxml regexp automata support is enabled.

[show source]
static VALUE rxml_enabled_automata_q(VALUE klass)
{
#ifdef LIBXML_AUTOMATA_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_automata? → (true|false)

Determine whether libxml regexp automata support is enabled.

[show source]
static VALUE rxml_enabled_automata_q(VALUE klass)
{
#ifdef LIBXML_AUTOMATA_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_c14n? → (true|false)

Determine whether libxml ‘canonical XML’ support is enabled. See “Canonical XML” (www.w3.org/TR/xml-c14n)

[show source]
static VALUE rxml_enabled_c14n_q(VALUE klass)
{
#ifdef LIBXML_C14N_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_c14n? → (true|false)

Determine whether libxml ‘canonical XML’ support is enabled. See “Canonical XML” (www.w3.org/TR/xml-c14n)

[show source]
static VALUE rxml_enabled_c14n_q(VALUE klass)
{
#ifdef LIBXML_C14N_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_catalog? → (true|false)

Determine whether libxml resource catalog support is enabled.

[show source]
static VALUE rxml_enabled_catalog_q(VALUE klass)
{
#ifdef LIBXML_CATALOG_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_catalog? → (true|false)

Determine whether libxml resource catalog support is enabled.

[show source]
static VALUE rxml_enabled_catalog_q(VALUE klass)
{
#ifdef LIBXML_CATALOG_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_debug? → (true|false)

Determine whether libxml debugging support is enabled.

[show source]
static VALUE rxml_enabled_debug_q(VALUE klass)
{
#ifdef LIBXML_DEBUG_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_debug? → (true|false)

Determine whether libxml debugging support is enabled.

[show source]
static VALUE rxml_enabled_debug_q(VALUE klass)
{
#ifdef LIBXML_DEBUG_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_docbook? → (true|false)

Determine whether libxml docbook support is enabled.

[show source]
static VALUE rxml_enabled_docbook_q(VALUE klass)
{
#ifdef LIBXML_DOCB_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_docbook? → (true|false)

Determine whether libxml docbook support is enabled.

[show source]
static VALUE rxml_enabled_docbook_q(VALUE klass)
{
#ifdef LIBXML_DOCB_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_ftp? → (true|false)

Determine whether libxml ftp client support is enabled.

[show source]
static VALUE rxml_enabled_ftp_q(VALUE klass)
{
#ifdef LIBXML_FTP_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_ftp? → (true|false)

Determine whether libxml ftp client support is enabled.

[show source]
static VALUE rxml_enabled_ftp_q(VALUE klass)
{
#ifdef LIBXML_FTP_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_html? → (true|false)

Determine whether libxml html support is enabled.

[show source]
static VALUE rxml_enabled_html_q(VALUE klass)
{
#ifdef LIBXML_HTML_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_html? → (true|false)

Determine whether libxml html support is enabled.

[show source]
static VALUE rxml_enabled_html_q(VALUE klass)
{
#ifdef LIBXML_HTML_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_http? → (true|false)

Determine whether libxml http client support is enabled.

[show source]
static VALUE rxml_enabled_http_q(VALUE klass)
{
#ifdef LIBXML_HTTP_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_http? → (true|false)

Determine whether libxml http client support is enabled.

[show source]
static VALUE rxml_enabled_http_q(VALUE klass)
{
#ifdef LIBXML_HTTP_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_iconv? → (true|false)

Determine whether libxml iconv support is enabled.

[show source]
static VALUE rxml_enabled_iconv_q(VALUE klass)
{
#ifdef LIBXML_ICONV_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_iconv? → (true|false)

Determine whether libxml iconv support is enabled.

[show source]
static VALUE rxml_enabled_iconv_q(VALUE klass)
{
#ifdef LIBXML_ICONV_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_memory_debug? → (true|false)

Determine whether libxml memory location debugging support is enabled.

[show source]
static VALUE rxml_enabled_memory_debug_location_q(VALUE klass)
{
#ifdef DEBUG_MEMORY_LOCATION
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_memory_debug? → (true|false)

Determine whether libxml memory location debugging support is enabled.

[show source]
static VALUE rxml_enabled_memory_debug_location_q(VALUE klass)
{
#ifdef DEBUG_MEMORY_LOCATION
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_regexp? → (true|false)

Determine whether libxml regular expression support is enabled.

[show source]
static VALUE rxml_enabled_regexp_q(VALUE klass)
{
#ifdef LIBXML_REGEXP_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_regexp? → (true|false)

Determine whether libxml regular expression support is enabled.

[show source]
static VALUE rxml_enabled_regexp_q(VALUE klass)
{
#ifdef LIBXML_REGEXP_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_schemas? → (true|false)

Determine whether libxml schema support is enabled.

[show source]
static VALUE rxml_enabled_schemas_q(VALUE klass)
{
#ifdef LIBXML_SCHEMAS_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_schemas? → (true|false)

Determine whether libxml schema support is enabled.

[show source]
static VALUE rxml_enabled_schemas_q(VALUE klass)
{
#ifdef LIBXML_SCHEMAS_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_thread? → (true|false)

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.

[show source]
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
}
XML.enabled_thread? → (true|false)

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.

[show source]
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
}
XML.enabled_unicode? → (true|false)

Determine whether libxml unicode support is enabled.

[show source]
static VALUE rxml_enabled_unicode_q(VALUE klass)
{
#ifdef LIBXML_UNICODE_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_unicode? → (true|false)

Determine whether libxml unicode support is enabled.

[show source]
static VALUE rxml_enabled_unicode_q(VALUE klass)
{
#ifdef LIBXML_UNICODE_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_xinclude? → (true|false)

Determine whether libxml xinclude support is enabled.

[show source]
static VALUE rxml_enabled_xinclude_q(VALUE klass)
{
#ifdef LIBXML_XINCLUDE_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_xinclude? → (true|false)

Determine whether libxml xinclude support is enabled.

[show source]
static VALUE rxml_enabled_xinclude_q(VALUE klass)
{
#ifdef LIBXML_XINCLUDE_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_xpath? → (true|false)

Determine whether libxml xpath support is enabled.

[show source]
static VALUE rxml_enabled_xpath_q(VALUE klass)
{
#ifdef LIBXML_XPATH_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_xpath? → (true|false)

Determine whether libxml xpath support is enabled.

[show source]
static VALUE rxml_enabled_xpath_q(VALUE klass)
{
#ifdef LIBXML_XPATH_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_xpointer? → (true|false)

Determine whether libxml xpointer support is enabled.

[show source]
static VALUE rxml_enabled_xpointer_q(VALUE klass)
{
#ifdef LIBXML_XPTR_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_xpointer? → (true|false)

Determine whether libxml xpointer support is enabled.

[show source]
static VALUE rxml_enabled_xpointer_q(VALUE klass)
{
#ifdef LIBXML_XPTR_ENABLED
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_zlib? → (true|false)

Determine whether libxml zlib support is enabled.

[show source]
static VALUE rxml_enabled_zlib_q(VALUE klass)
{
#ifdef HAVE_ZLIB_H
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.enabled_zlib? → (true|false)

Determine whether libxml zlib support is enabled.

[show source]
static VALUE rxml_enabled_zlib_q(VALUE klass)
{
#ifdef HAVE_ZLIB_H
  return(Qtrue);
#else
  return (Qfalse);
#endif
}
XML.features → ["feature", ..., "feature"]

Obtains an array of strings representing features supported (and enabled) by the installed libxml.

[show source]
static VALUE rxml_features(VALUE klass)
{
  VALUE arr, str;
  int i, len = MAX_LIBXML_FEATURES_LEN;
  char **list = NULL;

  list = ALLOC_N(char *,MAX_LIBXML_FEATURES_LEN);
  MEMZERO(list, char *, MAX_LIBXML_FEATURES_LEN);

  arr = rb_ary_new();
  if (xmlGetFeaturesList(&len, (const char **) list) == -1)
    return Qnil;

  for (i = 0; i < len; i++)
  {
    str = rb_str_new2((const char *) list[i]);
    rb_gc_unregister_address(&str);
    rb_ary_push(arr, str);
  }

  if (len == MAX_LIBXML_FEATURES_LEN)
    rb_warn(
        "Please contact libxml-devel@rubyforge.org and ask to have the \"MAX_LIBXML_FEATURES_LEN increased\" because you could possibly be seeing an incomplete list");

  ruby_xfree(list);
  return (arr);
}
XML.features → ["feature", ..., "feature"]

Obtains an array of strings representing features supported (and enabled) by the installed libxml.

[show source]
static VALUE rxml_features(VALUE klass)
{
  VALUE arr, str;
  int i, len = MAX_LIBXML_FEATURES_LEN;
  char **list = NULL;

  list = ALLOC_N(char *,MAX_LIBXML_FEATURES_LEN);
  MEMZERO(list, char *, MAX_LIBXML_FEATURES_LEN);

  arr = rb_ary_new();
  if (xmlGetFeaturesList(&len, (const char **) list) == -1)
    return Qnil;

  for (i = 0; i < len; i++)
  {
    str = rb_str_new2((const char *) list[i]);
    rb_gc_unregister_address(&str);
    rb_ary_push(arr, str);
  }

  if (len == MAX_LIBXML_FEATURES_LEN)
    rb_warn(
        "Please contact libxml-devel@rubyforge.org and ask to have the \"MAX_LIBXML_FEATURES_LEN increased\" because you could possibly be seeing an incomplete list");

  ruby_xfree(list);
  return (arr);
}
XML.indent_tree_output → (true|false)

Determines whether XML output will be indented (using the string supplied to default_indent_tree_string)

[show source]
static VALUE rxml_indent_tree_output_get(VALUE klass)
{
  if (xmlIndentTreeOutput)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.indent_tree_output → (true|false)

Determines whether XML output will be indented (using the string supplied to default_indent_tree_string)

[show source]
static VALUE rxml_indent_tree_output_get(VALUE klass)
{
  if (xmlIndentTreeOutput)
    return (Qtrue);
  else
    return (Qfalse);
}
XML.indent_tree_output = true|false

Controls whether XML output will be indented (using the string supplied to default_indent_tree_string)

[show source]
static VALUE rxml_indent_tree_output_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_TRUE)
  {
    xmlIndentTreeOutput = 1;
    return (Qtrue);
  }
  else if (TYPE(bool) == T_FALSE)
  {
    xmlIndentTreeOutput = 0;
    return (Qfalse);
  }
  else
  {
    rb_raise(rb_eArgError, "Invalid argument, must be boolean");
  }
}
XML.indent_tree_output = true|false

Controls whether XML output will be indented (using the string supplied to default_indent_tree_string)

[show source]
static VALUE rxml_indent_tree_output_set(VALUE klass, VALUE bool)
{
  if (TYPE(bool) == T_TRUE)
  {
    xmlIndentTreeOutput = 1;
    return (Qtrue);
  }
  else if (TYPE(bool) == T_FALSE)
  {
    xmlIndentTreeOutput = 0;
    return (Qfalse);
  }
  else
  {
    rb_raise(rb_eArgError, "Invalid argument, must be boolean");
  }
}
XML.memory_dump → (true|false)

Perform a parser memory dump (requires memory debugging support in libxml).

[show source]
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
}
XML.memory_dump → (true|false)

Perform a parser memory dump (requires memory debugging support in libxml).

[show source]
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
}
XML.memory_used → num_bytes

Perform a parser memory dump (requires memory debugging support in libxml).

[show source]
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
}
XML.memory_used → num_bytes

Perform a parser memory dump (requires memory debugging support in libxml).

[show source]
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
}