Displaying 20 results from an estimated 700 matches similar to: "Removing or overwriting an XML node"
2009 Jul 14
1
(simple) xml into data.frame and reverse
Hello,
I am trying to convert a simple data.frame (it will always be a few
equally long variables) into the XML format (which I don't understand
too well but need as input for another program) and reverse the
operation (from XML back into data.frame).
I found some code which does the first and it works good enough for me
(see below). Is there an easy way to reverse the operation? My XML
files
2005 May 02
2
"Special" characters in URI
Hello!
I am crossposting this to R-help and BioC, since it is relevant to both
groups.
I wrote a wrapper for Entrez search utility (link for this is provided bellow),
which can add some new search functionality to existing code in Bioconductor's
package 'annotate'*.
http://eutils.ncbi.nlm.nih.gov/entrez/query/static/esearch_help.html
Entrez search utuility returns a XML document
2010 Aug 30
4
getNodeSet - what am I doing wrong?
Hi,
Why is the following retuning a nodset of length 0:
> library(XML)
> test <- xmlTreeParse(
> "http://www.unimod.org/xml/unimod_tables.xml",useInternalNodes=TRUE)
> getNodeSet(test,"//modifications_row")
Thanks for any hint.
Joh
2011 Jul 05
2
Stuck ...can't get sapply and xmlTreeParse working
Can't seem to get the code below working. It gets stuck on line 24 inside the
function hm; comments show the line in question. The function hm is called
by sapply and is at the bottom of the code. Other stuff above line 24 works
correctly including the first couple of lines of the function hm. Should I
be using a different apply function or am I doing something wrong with
xmlTreeParse ?
2003 Feb 25
1
How to modify XML documents and save changes
Dear,
I want to read XML documents, add child nodes to some elements and store
everything back as an XML document.
I've tryed the following:
doc <- xmlTreeParse("file.xml")
QTListNode<-xmlElementsByTagName(xmlRoot(doc)[[1]],"tagname")
append.xmlNode(QTListNode[[1]],newXMLNode(name ="Norm", attrs = NULL))
saveXML(doc, file = "out.xml",
2011 Apr 06
1
Treatment of xml-stylesheet processing instructions in XML module
Hello again,
Another stumble here that is defeating me.
I try:
a<-readLines(url("http://feeds.feedburner.com/grokin"))
t<-XML::xmlTreeParse(a, ignoreBlanks=TRUE, replaceEntities=FALSE,
asText=TRUE)
elem<- XML::getNodeSet(XML::xmlRoot(t),"/rss/channel/item")[[1]]
And I get:
Start tag expected, '<' not found
Error: 1: Start tag expected, '<' not
2011 Apr 06
0
Curious treatment of entities in xmlTreeParse
Hello!
I am not experienced enough to know whether I have found a bug or
whether I am just ignorant.
I have been trying to use the tm package to read in material from RSS
2.0 feeds, which has required grappling with writing a reader for that
flavour of XML. I get an error - "Error : 1: EntityRef: expecting ';' -
which I think I've tracked down.
The feed being processed is from
2011 Feb 24
1
Objects must be passed as an argument or generated in the function, right?
Hi,
I'm new to R, and found this code confusing. It is from the bioconductor
package "RpsiXML".
entryCount <- length(nodes)
The "nodes" object is either the argument nor generated in the function.
How can R find the "nodes" object? What am I missing here?
Thanks
Zheng Jk
parseXmlEntryNodeSet <- function(psimi25file, psimi25source, verbose=TRUE) {
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
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
2008 Apr 29
4
XML write?
Is there any function to write a XML structure, after it was
read using xmlTreeParse?
Ex:
library(XML)
x <- xmlTreeParse("Irpf2008/aplicacao/dados/12345678901/12345678901.xml")
# write it...
Alberto Monteiro
PS: please, brazilians, don't be offended by my foul language!
2012 May 28
1
Rcurl, postForm()
Dear colleagues,
Could I get some assistance using postForm() to scrape the business names and addresses at this website:
http://www.brantford.ca/business/LocalBusinessCommunity/Pages/BusinessDirectorySearch.aspx
I've read through (http://www.omegahat.org/RCurl/RCurlJSS.pdf) and scoured the web for tutorials, but I can't crack it. I'm aware that this is probably a pretty basic
2012 May 11
0
Using xpathapply or getnodeset to get text between two distinct tags
Hello:
The following code extracts the links to the daily transcripts of Canada's House Of Commons. 'links' is a matrix of URLs (ncol=1), each of which points to one day's transcripts.
If you inspect the code for scrape(links[1]), you will find that periodically there appears an italicitze tag after a paragraph tag (<p some text ><i>Translation</i></p>.
2012 Dec 28
0
How to apply XPath query on XML nodes separately?
Dear R experts,
I try to extract certain child nodes from an XML document and construct a
table in which the parent node names are the columns and the child id
values, joined in a list, are the cell content.
If I first apply an XPath query to extract all above parent nodes, then
iterate over those nodes and again apply a XPath query to select their
child nodes, I get *ALL* matching child nodes
2011 Sep 05
2
htmlParse hangs or crashes
Dear colleagues,
each time I use htmlParse, R crashes or hangs. The url I'd like to parse is included below as is the results of a series of basic commands that describe what I'm experiencing. The results of sessionInfo() are attached at the bottom of the message.
The thing is, htmlTreeParse appears to work just fine, although it doesn't appear to contain the information I need (the
2007 Oct 16
3
sieve filtering, rewriting subjects
Is it possible to modify an emails subject line in a sieve script?
I've seen references to 'addtag' whilst googling, but it appears
dovecots implementation doens't support it - are there any other methods?
As a side note, can anyone suggest a web based script editor that works?
Simply a text area to write the script in would do
Thanks,
--
Ian P. Christian ~ pookey.co.uk
2008 Jun 25
0
Memory allocation failed: Copying Node
Following code bugs with "Memory allocation failed: Copying Node" error after
parsing n thousand files. I have included the main code(below) and
functions(after the main code).
I am not sure which lines are causing the copying Node which results in
memory failure. Please advise.
#Beginning of Code
for(i in 1:nrow(newFile)) {
if(i%%3000 == 0) gc()
2007 Jun 12
4
pretty report
Dear Listers:
I have a couple of data frames to report and each corresponds to
different condtions, e.g. conditions=c(10, 15, 20, 25). In this
examples, four data frames need to be exported in a "pretty" report.
I knew Perl has some module for exporting data to Excel and after
googling, I found R does not.
So I am wondering if there is a package in R for generating good
reports. I
2012 May 17
1
using XML package to read RSS
Hi,
I'm trying to use the XML package to read an RSS feed. To get
started, I was trying to use this post as an example:
http://www.r-bloggers.com/how-to-build-a-dataset-in-r-using-an-rss-feed-or-web-page/
I can replicate the beginning section of the post, but when I try to
use another RSS feed I have an issue. The RSS feed I would like to
use is:
> URL <-
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>