xml2 icon indicating copy to clipboard operation
xml2 copied to clipboard

XInclude functionality

Open krokkie opened this issue 2 years ago • 1 comments

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.

krokkie avatar Nov 22 '22 11:11 krokkie

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.

hadley avatar Oct 30 '23 18:10 hadley