- using R version 4.5.1 Patched (2025-08-11 r88641)
- using platform: x86_64-pc-linux-gnu
- R was compiled by
gcc-14 (Debian 14.2.0-19) 14.2.0
GNU Fortran (Debian 14.2.0-19) 14.2.0
- running under: Debian GNU/Linux forky/sid
- using session charset: UTF-8
- checking for file ‘XML/DESCRIPTION’ ... OK
- this is package ‘XML’ version ‘3.99-0.18’
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking whether package ‘XML’ can be installed ... WARNING
Found the following significant warnings:
DocParse.c:67:2: warning: ‘__xmlDoValidityCheckingDefaultValue’ is deprecated [-Wdeprecated-declarations]
DocParse.c:70:6: warning: ‘__xmlDoValidityCheckingDefaultValue’ is deprecated [-Wdeprecated-declarations]
HTMLParse.c:143:5: warning: ‘use’ is deprecated [-Wdeprecated-declarations]
HTMLParse.c:152:9: warning: ‘content’ is deprecated [-Wdeprecated-declarations]
RSDTD.c:121:3: warning: ‘validate’ is deprecated [-Wdeprecated-declarations]
RSDTD.c:134:7: warning: ‘xmlSkipBlankChars’ is deprecated [-Wdeprecated-declarations]
RSDTD.c:135:7: warning: ‘xmlParseMarkupDecl’ is deprecated [-Wdeprecated-declarations]
RUtils.c:142:5: warning: ‘xmlSubstituteEntitiesDefault’ is deprecated [-Wdeprecated-declarations]
XMLTree.c:1439:5: warning: ‘use’ is deprecated [-Wdeprecated-declarations]
XMLTree.c:1442:9: warning: ‘content’ is deprecated [-Wdeprecated-declarations]
XMLTree.c:1444:9: warning: ‘content’ is deprecated [-Wdeprecated-declarations]
See the install log for details.
- used C compiler: ‘gcc-14 (Debian 14.2.0-19) 14.2.0’
- checking package directory ... OK
- checking for future file timestamps ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [0s/1s] OK
- checking whether the package can be loaded with stated dependencies ... [0s/1s] OK
- checking whether the package can be unloaded cleanly ... [0s/1s] OK
- checking whether the namespace can be loaded with stated dependencies ... [0s/0s] OK
- checking whether the namespace can be unloaded cleanly ... [1s/1s] OK
- checking loading without being on the library search path ... [0s/1s] OK
- checking whether startup messages can be suppressed ... [1s/1s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [22s/28s] OK
- checking Rd files ... [1s/2s] OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking line endings in shell scripts ... OK
- checking line endings in C/C++/Fortran sources/headers ... OK
- checking line endings in Makefiles ... OK
- checking compilation flags in Makevars ... OK
- checking for GNU extensions in Makefiles ... OK
- checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
- checking use of PKG_*FLAGS in Makefiles ... OK
- checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK
- checking include directives in Makefiles ... OK
- checking pragmas in C/C++ headers and code ... OK
- checking compilation flags used ... OK
- checking compiled code ... NOTE
File ‘XML/libs/XML.so’:
Found non-API call to R: ‘OBJECT’
Compiled code should not call non-API entry points in R.
See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual,
and section ‘Moving into C API compliance’ for issues with the use of
non-API entry points.
- checking examples ... [9s/11s] ERROR
Running examples in ‘XML-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: xmlTreeParse
> ### Title: XML Parser
> ### Aliases: xmlTreeParse htmlTreeParse htmlParse xmlInternalTreeParse
> ### xmlNativeTreeParse xmlParse xmlSchemaParse
> ### Keywords: file IO
>
> ### ** Examples
>
> fileName <- system.file("exampleData", "test.xml", package="XML")
> # parse the document and return it in its standard format.
>
> xmlTreeParse(fileName)
$doc
$file
[1] "/home/hornik/tmp/R.check/r-patched-gcc/Work/build/Packages/XML/exampleData/test.xml"
$version
[1] "1.0"
$children
$children$comment
<!--A comment-->
$children$foo
<foo x="1">
<element attrib1="my value"/>
test entity bar <?R sum(rnorm(100))?>
<a>
<!--A comment-->
<b>%extEnt;</b>
</a>
<![CDATA[
This is escaped data
containing < and &. ]]>
Note that this caused a segmentation fault if replaceEntities was
not TRUE.
That is,
<code>xmlTreeParse("test.xml", replaceEntities = TRUE)</code>
works, but
<code>xmlTreeParse("test.xml")</code>
does not if this is called before the one above.
This is now fixed and was caused by
treating an xmlNodePtr in the C code
that had type XML_ELEMENT_DECL
and so was in fact an xmlElementPtr.
Aaah, C and casting!
</foo>
attr(,"class")
[1] "XMLDocumentContent"
$dtd
$external
NULL
$internal
$elements
$elements$y
$name
[1] "y"
$type
element
15
$contents
$type
Element
2
$ocur
Mult
3
$elements
[1] "x"
attr(,"class")
[1] "XMLElementContent"
$attributes
NULL
attr(,"class")
[1] "XMLElementDef"
$elements$x
$name
[1] "x"
$type
mixed
15
$contents
$type
PCData
1
$ocur
Once
1
$elements
NULL
attr(,"class")
[1] "XMLElementContent"
$attributes
NULL
attr(,"class")
[1] "XMLElementDef"
$entities
$entities$testEnt
$name
[1] "testEnt"
$value
[1] "test entity bar"
$original
[1] "test entity bar"
attr(,"class")
[1] "XMLEntity"
$entities$logo
$name
[1] "logo"
$value
[1] "gif"
$original
NULL
attr(,"class")
[1] "XMLEntity"
attr(,"class")
[1] "InternalDTD"
attr(,"class")
[1] "DTDList"
attr(,"class")
[1] "XMLDocument" "XMLAbstractDocument"
>
> # parse the document, discarding comments.
>
> xmlTreeParse(fileName, handlers=list("comment"=function(x,...){NULL}), asTree = TRUE)
$doc
$file
[1] "/home/hornik/tmp/R.check/r-patched-gcc/Work/build/Packages/XML/exampleData/test.xml"
$version
[1] "1.0"
$children
$children$foo
<foo x="1">
<element attrib1="my value"/>
test entity bar <?R sum(rnorm(100))?>
<a>
<b>%extEnt;</b>
</a>
<![CDATA[
This is escaped data
containing < and &. ]]>
Note that this caused a segmentation fault if replaceEntities was
not TRUE.
That is,
<code>xmlTreeParse("test.xml", replaceEntities = TRUE)</code>
works, but
<code>xmlTreeParse("test.xml")</code>
does not if this is called before the one above.
This is now fixed and was caused by
treating an xmlNodePtr in the C code
that had type XML_ELEMENT_DECL
and so was in fact an xmlElementPtr.
Aaah, C and casting!
</foo>
attr(,"class")
[1] "XMLDocumentContent"
$dtd
$external
NULL
$internal
$elements
$elements$x
$name
[1] "x"
$type
mixed
15
$contents
$type
PCData
1
$ocur
Once
1
$elements
NULL
attr(,"class")
[1] "XMLElementContent"
$attributes
NULL
attr(,"class")
[1] "XMLElementDef"
$elements$y
$name
[1] "y"
$type
element
15
$contents
$type
Element
2
$ocur
Mult
3
$elements
[1] "x"
attr(,"class")
[1] "XMLElementContent"
$attributes
NULL
attr(,"class")
[1] "XMLElementDef"
$entities
$entities$testEnt
$name
[1] "testEnt"
$value
[1] "test entity bar"
$original
[1] "test entity bar"
attr(,"class")
[1] "XMLEntity"
$entities$logo
$name
[1] "logo"
$value
[1] "gif"
$original
NULL
attr(,"class")
[1] "XMLEntity"
attr(,"class")
[1] "InternalDTD"
attr(,"class")
[1] "DTDList"
attr(,"class")
[1] "XMLDocument" "XMLAbstractDocument"
>
> # print the entities
> invisible(xmlTreeParse(fileName,
+ handlers=list(entity=function(x) {
+ cat("In entity",x$name, x$value,"\n")
+ x}
+ ), asTree = TRUE
+ )
+ )
In entity testEnt test entity bar
>
> # Parse some XML text.
> # Read the text from the file
> xmlText <- paste(readLines(fileName), "\n", collapse="")
>
> print(xmlText)
[1] "<?xml version=\"1.0\" ?> \n<!DOCTYPE foo [ \n <!ENTITY % bar \"for R and S\"> \n <!ENTITY % foo \"for Omegahat\"> \n \n <!ENTITY testEnt \"test entity bar\"> \n <!ENTITY logo SYSTEM \"images/logo.gif\" NDATA gif> \n <!ENTITY % extEnt SYSTEM \"http://www.omegahat.net\"> <!-- include the contents of the README file in the same directory as this one. --> \n \n <!ELEMENT x (#PCDATA) > \n <!ELEMENT y (x)* > \n]> \n<!-- A comment --> \n<foo x=\"1\"> \n <element attrib1=\"my value\" /> \n &testEnt; \n <?R sum(rnorm(100)) ?> \n <a> \n <!-- A comment --> \n <b> \n %extEnt; \n </b> \n </a> \n<![CDATA[ \n This is escaped data \n containing < and &. \n]]> \n \nNote that this caused a segmentation fault if replaceEntities was \nnot TRUE. \nThat is, \n<code> \nxmlTreeParse(\"test.xml\", replaceEntities = TRUE) \n</code> \nworks, but \n<code> \nxmlTreeParse(\"test.xml\") \n</code> \ndoes not if this is called before the one above. \nThis is now fixed and was caused by \ntreating an xmlNodePtr in the C code \nthat had type XML_ELEMENT_DECL \nand so was in fact an xmlElementPtr. \nAaah, C and casting! \n</foo> \n"
> xmlTreeParse(xmlText, asText=TRUE)
$doc
$file
[1] "<buffer>"
$version
[1] "1.0"
$children
$children$comment
<!--A comment-->
$children$foo
<foo x="1">
<element attrib1="my value"/>
test entity bar <?R sum(rnorm(100))?>
<a>
<!--A comment-->
<b>%extEnt;</b>
</a>
<![CDATA[
This is escaped data
containing < and &. ]]>
Note that this caused a segmentation fault if replaceEntities was
not TRUE.
That is,
<code>xmlTreeParse("test.xml", replaceEntities = TRUE)</code>
works, but
<code>xmlTreeParse("test.xml")</code>
does not if this is called before the one above.
This is now fixed and was caused by
treating an xmlNodePtr in the C code
that had type XML_ELEMENT_DECL
and so was in fact an xmlElementPtr.
Aaah, C and casting!
</foo>
attr(,"class")
[1] "XMLDocumentContent"
$dtd
$external
NULL
$internal
$elements
$elements$y
$name
[1] "y"
$type
element
15
$contents
$type
Element
2
$ocur
Mult
3
$elements
[1] "x"
attr(,"class")
[1] "XMLElementContent"
$attributes
NULL
attr(,"class")
[1] "XMLElementDef"
$elements$x
$name
[1] "x"
$type
mixed
15
$contents
$type
PCData
1
$ocur
Once
1
$elements
NULL
attr(,"class")
[1] "XMLElementContent"
$attributes
NULL
attr(,"class")
[1] "XMLElementDef"
$entities
$entities$logo
$name
[1] "logo"
$value
[1] "gif"
$original
NULL
attr(,"class")
[1] "XMLEntity"
$entities$testEnt
$name
[1] "testEnt"
$value
[1] "test entity bar"
$original
[1] "test entity bar"
attr(,"class")
[1] "XMLEntity"
attr(,"class")
[1] "InternalDTD"
attr(,"class")
[1] "DTDList"
attr(,"class")
[1] "XMLDocument" "XMLAbstractDocument"
>
>
> # with version 1.4.2 we can pass the contents of an XML
> # stream without pasting them.
> xmlTreeParse(readLines(fileName), asText=TRUE)
$doc
$file
[1] "<buffer>"
$version
[1] "1.0"
$children
$children$comment
<!--A comment-->
$children$foo
<foo x="1">
<element attrib1="my value"/>
test entity bar <?R sum(rnorm(100))?>
<a>
<!--A comment-->
<b>%extEnt;</b>
</a>
<![CDATA[
This is escaped data
containing < and &. ]]>
Note that this caused a segmentation fault if replaceEntities was
not TRUE.
That is,
<code>xmlTreeParse("test.xml", replaceEntities = TRUE)</code>
works, but
<code>xmlTreeParse("test.xml")</code>
does not if this is called before the one above.
This is now fixed and was caused by
treating an xmlNodePtr in the C code
that had type XML_ELEMENT_DECL
and so was in fact an xmlElementPtr.
Aaah, C and casting!
</foo>
attr(,"class")
[1] "XMLDocumentContent"
$dtd
$external
NULL
$internal
$elements
$elements$x
$name
[1] "x"
$type
mixed
15
$contents
$type
PCData
1
$ocur
Once
1
$elements
NULL
attr(,"class")
[1] "XMLElementContent"
$attributes
NULL
attr(,"class")
[1] "XMLElementDef"
$elements$y
$name
[1] "y"
$type
element
15
$contents
$type
Element
2
$ocur
Mult
3
$elements
[1] "x"
attr(,"class")
[1] "XMLElementContent"
$attributes
NULL
attr(,"class")
[1] "XMLElementDef"
$entities
$entities$logo
$name
[1] "logo"
$value
[1] "gif"
$original
NULL
attr(,"class")
[1] "XMLEntity"
$entities$testEnt
$name
[1] "testEnt"
$value
[1] "test entity bar"
$original
[1] "test entity bar"
attr(,"class")
[1] "XMLEntity"
attr(,"class")
[1] "InternalDTD"
attr(,"class")
[1] "DTDList"
attr(,"class")
[1] "XMLDocument" "XMLAbstractDocument"
>
>
> # Read a MathML document and convert each node
> # so that the primary class is
> # <name of tag>MathML
> # so that we can use method dispatching when processing
> # it rather than conditional statements on the tag name.
> # See plotMathML() in examples/.
> fileName <- system.file("exampleData", "mathml.xml",package="XML")
> m <- xmlTreeParse(fileName,
+ handlers=list(
+ startElement = function(node){
+ cname <- paste(xmlName(node),"MathML", sep="",collapse="")
+ class(node) <- c(cname, class(node));
+ node
+ }))
>
>
>
> # In this example, we extract _just_ the names of the
> # variables in the mtcars.xml file.
> # The names are the contents of the <variable>
> # tags. We discard all other tags by returning NULL
> # from the startElement handler.
> #
> # We cumulate the names of variables in a character
> # vector named 'vars'.
> # We define this within a closure and define the
> # variable function within that closure so that it
> # will be invoked when the parser encounters a <variable>
> # tag.
> # This is called with 2 arguments: the XMLNode object (containing
> # its children) and the list of attributes.
> # We get the variable name via call to xmlValue().
>
> # Note that we define the closure function in the call and then
> # create an instance of it by calling it directly as
> # (function() {...})()
>
> # Note that we can get the names by parsing
> # in the usual manner and the entire document and then executing
> # xmlSApply(xmlRoot(doc)[[1]], function(x) xmlValue(x[[1]]))
> # which is simpler but is more costly in terms of memory.
> fileName <- system.file("exampleData", "mtcars.xml", package="XML")
> doc <- xmlTreeParse(fileName, handlers = (function() {
+ vars <- character(0) ;
+ list(variable=function(x, attrs) {
+ vars <<- c(vars, xmlValue(x[[1]]));
+ NULL},
+ startElement=function(x,attr){
+ NULL
+ },
+ names = function() {
+ vars
+ }
+ )
+ })()
+ )
>
> # Here we just print the variable names to the console
> # with a special handler.
> doc <- xmlTreeParse(fileName, handlers = list(
+ variable=function(x, attrs) {
+ print(xmlValue(x[[1]])); TRUE
+ }), asTree=TRUE)
[1] "mpg"
[1] "cyl"
[1] "disp"
[1] "hp"
[1] "drat"
[1] "wt"
[1] "qsec"
[1] "vs"
[1] "am"
[1] "gear"
[1] "carb"
>
>
> # This should raise an error.
> try(xmlTreeParse(
+ system.file("exampleData", "TestInvalid.xml", package="XML"),
+ validate=TRUE))
*** caught segfault ***
address 0xfe3c, cause 'memory not mapped'
Traceback:
1: xmlTreeParse(system.file("exampleData", "TestInvalid.xml", package = "XML"), validate = TRUE)
2: doTryCatch(return(expr), name, parentenv, handler)
3: tryCatchOne(expr, names, parentenv, handlers[[1L]])
4: tryCatchList(expr, classes, parentenv, handlers)
5: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call, nlines = 1L) prefix <- paste("Error in", dcall, ": ") LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))})
6: try(xmlTreeParse(system.file("exampleData", "TestInvalid.xml", package = "XML"), validate = TRUE))
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault
- checking PDF version of manual ... [11s/14s] OK
- checking HTML version of manual ... [5s/9s] OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 1 ERROR, 1 WARNING, 1 NOTE