similar to: XML - get node by name

Displaying 20 results from an estimated 10000 matches similar to: "XML - get node by name"

2008 Sep 08
1
another XML package question
Hi there, does anybody know how to return the xmlPath from a node? For example, at several location in the xml file, I have nodes with the same name and I'd like to process only the nodes from a certain path. Any idea? Antje
2008 Jun 12
1
XML parameters to Column Headers for importing into a dataset
Dear List, Do you know any way I can convert XML parameters into column headers. My data is in a csv file with each row containing a xml form of data , and multiple parameters ( <param1> data_val1 </param2> , <param2> data_val2 </param2> ) I want to convert it so each row caters to one record and each parameter becomes a different column. param1
2008 May 02
1
How to parse XML
I would like to learn how to parse a mixed text/xml document I downloaded from the sec.gov website (see example below). I would like to parse this to get the value for each xml tag and then access it within R, but I don't know much about xml so I don't even know where to start debugging the errors I am getting in this example code. Can anyone help me get started? Thanks, Roger ftp
2011 Mar 30
1
Package XML: Parse Garmin *.tcx file problems
I'm struggling with package XML to parse a Garmin file (named *.tcx). I wonder if it's form is incomplete, but appreciably reluctant to paste even a shortened version. The output below shows I can get nodes, but an attempt at value of a single node comes up empty (even though there is data there. One question: Has anybody succeeded parsing Garmin .tcx (xml) files? Thanks! Michael
2008 Oct 06
3
Extracting text from html code using the RCurl package.
Dear R-help, I want to download the text from a web page, however what i end up with is the html code. Is there some option that i am missing in the RCurl package? Or is there another way to achieve this? This is the code i am using: > library(RCurl) > my.url <- 'https://stat.ethz.ch/mailman/listinfo/r-help' > html.file <- getURI(my.url, ssl.verifyhost = FALSE,
2008 Jun 10
1
Parse XML
Could someone provide a link or examples of parsing XML document in R? Few specific questions below: For instance I can retrieve specific nodes using this: node <- xpathApply(xml, "//" %+% xtag, xmlValue) 1) I want to be able to retrieve parent node for this node, how can I do this? getParentNode() does not seem to cut it. 2) How can I retrieve children nodes for a particular
2008 Apr 12
1
Extracting a data.frame from HTML code
Dear all, I'd like to use R to read in data from the web. I need some help finding an efficient way to strip the HTML tags and reformat the data as a data.frame to analyze in R. I'm currently using readLines() to read in the HTML code and then grep() to isolate the block of HTML code I want from each page, but this may not be the best approach. A short example: x1 <- readLines("
2009 Mar 02
2
Need help extracting info from XML file using XML package
I have an XML file that has within it the coordinates of some polygons that I would like to extract and use in R. The polygons are nested rather deeply. For example, I found by trial and error that I can extract the coordinates of one of them using functions from the XML package: doc <- xmlInternalTreeParse('doc.kml') docroot <- xmlRoot(doc) pgon <-
2008 Sep 22
2
paste with list
Hello, I guess the solution is rather simple but whatever I tried, I don't manage to get the result as I want to have it: I have several vectors of equal length in a list and I'd like to combine all first elements to a single string, all second elements to a single string, ..., all n-th elements to a single string. # Example code (how it should look like): t1 <- c(1,2,3) t2 <-
2007 Dec 14
6
Analyzing Publications from Pubmed via XML
I would like to track in which journals articles about a particular disease are being published. Creating a pubmed search is trivial. The search provides data but obviously not as an R dataframe. I can get the search to export the data as an xml feed and the xml package seems to be able to read it. xmlTreeParse("
2011 Oct 26
1
Webscraping - How to Scrape Out Text Into R As If Copied & Pasted From Webpage?
Greetings, I am trying to get all of the text from a web page as if I "selected all" on the page, pasted into a text file, and then read in the text file with read.csv(). # this is the actual page I'm trying to acquire text from: web.pg <- readLines("http://www.airweb.org/?page=574") # then parsed in hopes of an easier structure to work with: web.pg <-
2007 Nov 18
4
Re ad HTML table
You can use htmlTreeParse and xpathApply from the XML library. something like: xpathApply( htmlTreeParse("http://blabla", useInt=T), "//td", function(x) xmlValue(x)) should do it. Gamma wrote: > > anyone care to explain how to read a html table, it's streaming data > (updated every second) and i am looking for a suitable function. > > The imported html
2009 Jul 01
3
is there a way to extract fata from web pages through some R function ?
I deal with a huge amount of Biology data stored in different databases. The databases belongig to Bioconductor organization can be accessed through Bioconductor packages. Unluckily some useful data is stored in databases like, for instance, miRDB, miRecords, etc ... which offer just an interactive HTML interface. See for instance http://mirdb.org/cgi-bin/search.cgi,
2012 Aug 10
3
Parsing large XML documents in R - how to optimize the speed?
Hello everyone, I would like to parse very large xml files from MS/MS experiments and create R objects from their content. (By very large, I mean going up to 5-10Gb, although I am using a 'small' 40M file to test my code.) My first attempt at parsing the 40M file, using the XML package, took more than 2200 seconds and left me quite disappointed. I managed to cut that down to around 40
2009 Sep 03
1
encoding problem using xml package
Dear list I tried to read an xml file using the xml package. Unfortunately, some encoding problems occure. E.g. german Umlaut will be red correctly. I assume that the occurs due to (internal?) conversion to utf-8. To illustrate the problem, I have wrote to xml files. File Test 1 ----------- <?xml version="1.0" encoding="ISO-8859-1"?> <Daten> <ITEM>
2011 Mar 29
2
Scrap java scripts and styles from an html document
Hi, I am working on developing a web crawler in R and I needed some help with regard to removal of javascripts and style sheets from the html document of a web page. i tried using the xml package, hence the function xpathApply library(XML) txt = xpathApply(html,"//body//text()[not(ancestor::script)][not(ancestor::style)]", xmlValue) The output comes out as text lines, without any html
2007 Sep 01
2
Importing huge XML-Files
Dear all, for my diploma thesis I have to import huge XML-Files into R for statistical processing - huge means a size about 33 MB. I'm using the XML-Package version 1.9 As far as reading the complete file into R via xmlTreeParse doesn't work or is too slow, I'm trying to use xmlEventParse but I got completely stuck. I have many different type of nodes + <configuration>
2011 May 30
1
Need help reading website info with XML package and XPath
Hi, I'm looking for help extracting some information of the zillow website. I'd like to do this for the general case where I manually change the address by modifying the url (see code below). With the url containing the address, I'd like to be able to extract the same information each time. The specific information I'd like to be able to extract includes the homedetails url, price
2009 Oct 15
1
Removing Embedded Null characters from text/html
Hi, I'm trying to download some data from the web and am running into problems with 'embedded null' characters. These seem to indicate to R that it should stop processing the page so I'd like to remove them. I've been looking around and can't seem to identify exactly what the character is and consequently how to remove it. # THE CODE WORKS ON THIS PAGE library(RCurl)
2009 Sep 09
1
Package that does not work until I re write the exactly the same code
Hi the list, I am writing a package in S4 and I do not manage to understand a bug. The "R CMD check" and the "R CMD build" both work. Here is links to the package (not on CRAN yet for the raison that I explain bellow): http://christophe.genolini.free.fr/aTelecharger/kml_0.5.zip http://christophe.genolini.free.fr/aTelecharger/kml_0.5.tar.gz Then I install the package and I