Open AshesITR opened 9 months ago
Since c.xml_nodeset ist not defined, combining nodesets drops the class and breaks the following usage if not manually applying the class:
c.xml_nodeset
library(xml2) xml <- xml_ns_strip(read_xml(xml2_example("order-doc.xml"))) st <- xml_find_all(xml, "//shipTo") bt <- xml_find_all(xml, "//billTo") both <- c(st, bt) class(both) <- "xml_nodeset" xml_find_all(both, "name") #> {xml_nodeset (2)} #> [1] <name>Alice Smith</name> #> [2] <name>Robert Smith</name> xml_find_all(c(st, bt), "name") #> Error in UseMethod("xml_find_all"): no applicable method for 'xml_find_all' applied to an object of class "list"
Created on 2023-12-13 with reprex v2.0.2
Since
c.xml_nodeset
ist not defined, combining nodesets drops the class and breaks the following usage if not manually applying the class:Created on 2023-12-13 with reprex v2.0.2