xmlTree()
xmlTree()
dtdFile <- system.file("data/foo.dtd", pkg="XML") > foo.dtd <- parseDTD(dtdFile) > tmp <- dtdElement("variable", foo.dtd) Error in dtd$elements[[name]] : object is not subsettable > foo.dtd$elements ""ExternalDTD""
source("dataFrameHandler.R") z <- xmlEventParse("../DTDs/Examples/mtcars.xml", handler=handler())causes problems with an incorrect number of elements in the third record. It reads the 22.8 as 2 and then 2.8 Removing some of the spaces before the 22.8 at the beginning of the record makes this go away. Need to investigate further.
Can cat()
output or paste()
, but
can do more to ensure well-formed documents relative to a DTD.
Have a filter that knows what DTD, or collection of DTDs, to use
and how to ensure that individual calls do the correct thing in
the context. So basically keep a cursor.
Can read DTDs within this one. The filter can be built from this.
See Writing XML.
h <- .Call("R_XMLParse", "Docs/test.xml",xmlHandler(), F, F)
xmlTreeParse()
.
[
and [<-
methods for the different types of nodes.
And also functions such as those in the w3c spec
for nodes, getElementsByTagName, etc.
[[
for accessing children, avoiding
the need for $children[[]]
.
NULL
, remove from tree (or actually don't
add it).