Displaying 20 results from an estimated 900 matches similar to: "XML write?"
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",
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
2004 Aug 12
1
Error Using pm.getabst()
R Users:
After installing Bioconductor, RSXML and all the relevant Win32 DLLs (libxml2, zlib, iconv), I receive the following error message when using pm.getabst()
Error in xmlRoot(absts) : no applicable method for "xmlRoot"
I receive this when using the example from help(pm.getabst).
Downloading the target XML file, parsing it with xmlTreeParse and applying xmlRoot returns no
2008 Jul 02
1
Removing or overwriting an XML node
Hi,
I have an existing XML document on disk, which I'd like
to use as a template, and exchange a subnode with my own
newly created subtree:
<?xml version="1.0"?>
<Duncan>
<name a="1" b="xyz">
<first>Duncan</first>
<last>Temple Lang</last>
</name>
</Duncan>
created by e.g.
? library(XML)
2005 Mar 11
3
XML to data frame or list
Dear useRs,
I have a simple/RTFM question about XML parsing. Given an XML file,
such as (fragment)
<A>100</A>
<B>23</B>
<C>true</C>
how do I import it in a data frame or list, so that the values (100,
23, true) can be accessed through the names A, B and C?
I installed the XML package and looked over the documentation...
however after 20 minutes and a couple of
2010 Apr 06
1
GridR
Dear All
I am doing one distributed data mining program. So I selected GridR
package for the distributed programming.
*grid.init(service="local",debug=FALSE, localTmpDir="GridRTmp/")
grid.apply("x",UCS, wait=TRUE )*
UCS is a function.
When I execute this statement, I have some errors like :
*cannot load local function/variable: xmlRoot
extracted from line: : no
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 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 Jun 29
2
parse XML file
Hi all,
this is my first post in this mailing group. I hope that anyboby could
help me parsing a xml file.
I found this website http://www.omegahat.org/RSXML/gettingStarted.html
but unfortunately my XML file is not as easy as the one in the example.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet
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
2013 Apr 12
1
Problem with handling of attributes in xmlToList in XML package
Hello all,
I have a problem with the way attributes are dealt with in the
function xmlToList(), and I haven't been able to figure it out for
days now.
Say I have a document (produced by nmap) like this:
> mydoc <- '<host starttime="1365204834" endtime="1365205860"><status state="up" reason="echo-reply"
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
2013 Jan 22
2
Creating a Data Frame from an XML
Hello,
I'm attempting to read information from an XML into a data frame in R using
the "XML" package. I am unable to get the data into a data frame as I would
like. I have some sample code below.
*XML Code:*
Header...
Data I want in a data frame:
<data>
<row BRAND="GMC" NUM="1" YEAR="1999" VALUE="10000" />
<row
2005 May 08
2
Extract just some fields from XML
Hello!
I am trying to get specific fields from an XML document and I am totally
puzzled. I hope someone can help me.
# URL
URL<-"http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=11877539,11822933,11871444&retmode=xml&rettype=citation"
# download a XML file
tmp <- xmlTreeParse(URL, isURL = TRUE)
tmp <- xmlRoot(tmp)
Now I want to extract only
2012 May 20
3
dot - comma problem
Dear all
I am trying to use the ODB package to connect to an libreoffice-odb database.
The libreoffice package is german, thus, decimal separator is a comma. However,
I can open the database and upload a it without error,
library(ODB)
db <- odb.open("Test.odb")
but a soon as the "odb.open" command is executed, the decimal separator in R
is changed to comma.
Before
2012 Nov 14
2
How to filter xml value in R?
Hi,
I have one xml file.
<Class>
<Node1 code ="1"> First node </Node1>
<Node2 code ="1"> Second node </Node2>
<Node3 code ="1"> Third node </Node3>
<Node1 code ="2"> Fourth node </Node1>
</Class>
for (i in 1:xmlSize())
{
print(Class[i]) # how can i filter Node1 ?
}
by
2012 Feb 23
1
multiple gsub
Hi Guys,
I am relatively new to R and was wondering if I could next my gsub command
in identifying one object
I have data which looks like this: <name>Taiwan_250km</name>
I want it to look like this: Taiwan_250km
So essentially I just want to gsub '<name>' and </name> with nothing!
So far I have got this: PolyNam <-
2012 Dec 20
4
Memory filling up while looping
Hey,
I have an double loop like this:
chunk <- list(1:10, 11:20, 21:30)
for(k in 1:length(chunk)){
print(chunk[k])
DummyCatcher <- NULL
for(i in chunk[k]){
print("i load something")
dummy <- 1
print("i do something")
dummy <- dummy + 1
print("i do put it together")
DummyCatcher = rbind(DummyCatcher, dummy)
}
print("i save a chunk
2010 Mar 16
2
Retrieving latitude and longitude via Google Maps API
Does anyone have any experience retrieving latitutde and longitude for
an address from the Google Maps API?
I'd like to have an R script that submits a street address, city, state,
and zip code and returns the coordinates. So far, I've been submitting
the coordinates from another program, then loading the coordinates in R
and merging them back into the data frame I want to use.