R Under development (unstable) (2026-02-09 r89390 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(XML) > > # Changed after 3.99-0.16.1: replaced the use of xmlKeepBlanksDefault() > # with the NOBLANKS parser option. The output must stay the same. > for (trim in c(TRUE, FALSE)) for (useInternalNodes in c(TRUE, FALSE)) + print( + xmlValue( + xmlChildren( + xmlRoot( + xmlTreeParse( + system.file( + 'extdata/keep_blanks.xml', + package = 'XML' + ), + trim = trim, + useInternalNodes = useInternalNodes + ) + ) + )[[1+!trim]] + ) + ) [1] "\n Depending on the \"trim\" option, blanks before and after this\n sentence may be stripped.\n " [1] "Depending on the \"trim\" option, blanks before and after this\n sentence may be stripped." [1] "\n Depending on the \"trim\" option, blanks before and after this\n sentence may be stripped.\n " [1] "\n Depending on the \"trim\" option, blanks before and after this\n sentence may be stripped.\n " > for (trim in c(TRUE, FALSE)) print( + getNodeSet( + xmlRoot(htmlParse( + '
Barwat
', + asText = TRUE, useInternalNodes = TRUE + ) > stopifnot(is(html, 'HTMLInternalDocument')) > # calls RS_XML_dumpHTMLDoc() > cat(saveXML(html, indent = TRUE))wat
> cat(saveXML(html, indent = FALSE))wat
> rm(html) > > xml <- xmlParse( + '