Skip to content

xml2 1.1.0

Compare
Choose a tag to compare
@jeroen jeroen released this 08 Jan 12:31
· 235 commits to master since this release

New Features

  • write_xml() and write_html() now accept connections as well as filenames
    for output. (#157)
  • xml_add_child() now takes a .where argument specifying where to add the
    new children. (#138)
  • as_xml() generic function to convert R objects to xml. The most important
    method is for lists and enables full roundtrip support for going to and back
    from xml for lists and enables full roundtrip support to and from XML. (#137, #143)
  • xml_new_root() can be used to create a new document and a root node in one step (#131).
  • xml_add_parent() inserts a new node between the node and its parent (#129)
  • Add xml_validate() to validate a document against an xml schema (#31, @jeroenooms).
  • Export xml2_types.h to allow for extension packages such as xslt.
  • xml_comment() allows you to add comment nodes to a document. (#111)
  • xml_cdata() allows you to add CDATA nodes to a document. (#128)
  • Add xml_set_text() and xml_set_name() equivalent to xml_text<- and xml_name<-. (#130).
  • Add xml_set_attr() and xml_set_attrs() equivalent to xml_attr<- and xml_attrs<-. (#109, #130)
  • Add write_html() method (#133).

Bugfixes

  • xml_new_document() now explicitly sets the encoding (default UTF-8) (#142)
  • Document formatting options for write_xml() (#132)
  • Add missing methods for xml_missing objects. (#134)
  • Bugfix for xml_length.xml_nodeset that caused it to fail unconditionally. (#140)
  • is.na() now returns TRUE for xml_missing objects. (#139)
  • Trim non-breaking spaces in xml_text(trim = TRUE) (#151).
  • Allow setting non-character attributes (values are coerced to characters). (@sjp, #117, #122).
  • Fixed return value in call to vapply in xml_integer.xml_nodeset. (@ddiez, #146, #147).
  • Allow docs missing a root element to be created and printed. (@sjp, #126, #121).
  • xml_add_* methods now return invisibly. (@sjp, #124)
  • as_list() now preserves element names when attributes exist, and escapes
    XML attributes that conflict with special R attributes (@peterfoley, #115).