SCM

SCM Repository

[tm] Diff of /pkg/R/source.R
ViewVC logotype

Diff of /pkg/R/source.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 985, Thu Aug 27 18:09:05 2009 UTC revision 986, Tue Sep 1 15:33:30 2009 UTC
# Line 66  Line 66 
66    
67  # XML  # XML
68  XMLSource <- function(x, parser, reader, encoding = "UTF-8") {  XMLSource <- function(x, parser, reader, encoding = "UTF-8") {
     require("XML")  
   
69      corpus <- readLines(x, encoding = encoding)      corpus <- readLines(x, encoding = encoding)
70      tree <- XML::xmlTreeParse(corpus, asText = TRUE)      tree <- XML::xmlTreeParse(corpus, asText = TRUE)
71      content <- parser(tree)      content <- parser(tree)
# Line 95  Line 93 
93  getElem.URISource <- function(x) list(content = readLines(eval(x$URI)), uri = x$URI)  getElem.URISource <- function(x) list(content = readLines(eval(x$URI)), uri = x$URI)
94  getElem.VectorSource <- function(x) list(content = x$Content[x$Position], uri = match.call()$x)  getElem.VectorSource <- function(x) list(content = x$Content[x$Position], uri = match.call()$x)
95  getElem.XMLSource <- function(x) {  getElem.XMLSource <- function(x) {
     require("XML")  
   
96      # Construct a character representation from the XMLNode      # Construct a character representation from the XMLNode
97      virtual.file <- character(0)      virtual.file <- character(0)
98      con <- textConnection("virtual.file", "w", local = TRUE)      con <- textConnection("virtual.file", "w", local = TRUE)
99      saveXML(x$Content[[x$Position]], con)      XML::saveXML(x$Content[[x$Position]], con)
100      close(con)      close(con)
101    
102      list(content = virtual.file, uri = x$URI)      list(content = virtual.file, uri = x$URI)

Legend:
Removed from v.985  
changed lines
  Added in v.986

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge