r-lib / xml2

Bindings to libxml2
https://xml2.r-lib.org/
Other
220 stars 81 forks source link

XInclude functionality #378

Open krokkie opened 2 years ago

krokkie commented 2 years ago

Does xml2 have the XInclude functionality ?

XML has an example where they illustrate the use of the XInclude functionality, which is exactly what I need.
It appears as if xml2 cannot handle this (yet). But I don't want to move back to XML again - having made the transition to xml2 some time back.

The example from the XML package I'm referring to:

   f = system.file("exampleData", "nodes1.xml", package = "XML")
   x1 <- XML::xmlRoot(XML::xmlTreeParse(f, xinclude = FALSE))
   x2 <- XML::xmlRoot(XML::xmlTreeParse(f, xinclude = TRUE))

I can see there is a option XINCLUDE in xml2::read_xml, but I could not manage to make this work in the example above. It is advertised as "implement XInclude substitition", but I'm not sure what exactly this refers to.

hadley commented 1 year ago

It doesn't currently, but it looks like it might not be too much work to add it, when we're next working on xml2.