search for: xmlvalu

Displaying 20 results from an estimated 52 matches for "xmlvalu".

Did you mean: xmlval
2011 May 30
1
Need help reading website info with XML package and XPath
...ontains(@href,'homedetails')]") f2 <- getNodeSet(doc, "//span[contains(@class,'price')]") f3 <- getNodeSet(doc, "//LIST[@Beds]") f4 <- getNodeSet(doc, "//LIST[@Baths]") f5 <- getNodeSet(doc, "//LIST[@Sqft]") g1 <-sapply(f1, xmlValue) g2 <-sapply(f2, xmlValue) g3 <-sapply(f3, xmlValue) g4 <-sapply(f4, xmlValue) g5 <-sapply(f5, xmlValue) print(f1) -- View this message in context: http://r.789695.n4.nabble.com/Need-help-reading-website-info-with-XML-package-and-XPath-tp3561075p3561075.html Sent from the R help mai...
2011 Jul 05
2
Stuck ...can't get sapply and xmlTreeParse working
...x, sep="") ############## problem line is next ################################# zdoc <-xmlTreeParse(url.zill, useInternalNode=TRUE, isURL=TRUE) ############# problem line above ################################## f$zpid <- sapply(getNodeSet(zdoc, "//result/zpid"), xmlValue) f$zest.low <-sapply(getNodeSet(zdoc, "//valuationRange/low"), xmlValue) f$zest <- sapply(getNodeSet(zdoc, "//zestimate/amount"), xmlValue) rm(zdoc) return(f) } j <-sapply(new.add, FUN=hm) print(zest) -- View this message in context: http://r.789695.n4.nabble....
2012 Aug 10
3
Parsing large XML documents in R - how to optimize the speed?
...ile", getDTD=FALSE, useInternalNodes=TRUE) result <- new('S4_result_class') result@proteins <- xpathApply(xml.doc, "//model/protein", function(protein.node) { protein <- new('S4_protein_class') ## fill in a couple of attributes of the protein object using xmlValue and xmlAttrs(protein.node) protein@peptides <- xpathApply(protein.node, "./peptide", function(peptide.node) { peptide <- new('S4_peptide_class') ## fill in a couple of attributes of the peptide object using xmlValue and xmlAttrs(peptide.node) peptide@aas <-...
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("
2009 Sep 03
1
encoding problem using xml package
...uot; encoding="ISO-8859-1"?> <Daten> <ITEM> <Messdaten> <MESSUNG> <BEZEICHNUNG>Länge</BEZEICHNUNG> </MESSUNG> </Messdaten> </ITEM> </Daten> > xpathApply(doc,"//MESSUNG/BEZEICHNUNG", xmlValue) [[1]] [1] "Länge" > doc <- xmlTreeParse(fname2,useInternalNodes=T) > show(doc) <?xml version="1.0" encoding="utf-8"?> <Daten> <ITEM> <Messdaten> <MESSUNG> <BEZEICHNUNG>Länge</BEZEICHNUNG>...
2012 Oct 26
1
Parsing very large xml datafiles with SAX: How to profile <anonymous> functions?
...149.38 98.77 0.00 0.00 "xmlEventParse" 149.38 98.77 0.00 0.00 ".Call" 149.32 98.73 3.04 2.01 "<Anonymous>" 146.74 97.02 141.26 93.40 <--- !! "xmlValue" 3.04 2.01 0.46 0.30 "xmlValue.XMLInternalNode" 2.58 1.71 0.14 0.09 "standardGeneric" 2.12 1.40 0.50 0.33 "gc" 1.86 1.23 1.86 1.23 ......
2009 Dec 31
3
XML and RCurl: problem with encoding (htmlTreeParse)
...> > site <- getURL("http://www.aarresaari.net/jobboard/jobs.html") > txt <- readLines(tc <- textConnection(site)); close(tc) > txt <- htmlTreeParse(txt, error=function(...){}, useInternalNodes = TRUE) > > g <- xpathSApply(txt, "//p", function(x) xmlValue(x)) > head(grep(" ", g, value=T)) [1] "????PART-TIME EXPORT SALES ASSOCIATES (ALSO SUMMER WORK) ? Valuatum Oy ??Helsinki ??Ilmoitus lis??tty: 31.12.2009. Viimeinen hakup??iv??: 28.02.2010" [2] "????MSN EDITOR / ONLINE PRODUCER ??Manpower Oy ??Espoo ??Ilmoitus lis??tty:...
2008 Jun 25
0
Memory allocation failed: Copying Node
...l and xValHelper are prerty similar hence avoiding code for xValHelper xValHelperSpecial <- function(node, xtag) { nobs <- xmlSize(node) out<-NULL if(xtag == "tagName1") { for (n in seq(1:nobs)) { temp <- xpathApply(node[[n]], "//" %+% xtag, xmlValue) if(length(temp) > 0) { if (n==1) assign("out",gsub('(^ +)|( +$)','',gsub('\n','',temp[[1]]))) else assign("out",rbind(out,gsub('(^ +)|( +$)','',gsub('\n','',temp[[1]])...
2011 Mar 30
1
Package XML: Parse Garmin *.tcx file problems
...thApply(doc2, "//*", xmlName) [[1]] [1] "TrainingCenterDatabase" [[2]] [1] "Activities" [[3]] [1] "Activity" [[4]] [1] "Id" [[5]] [1] "Lap" [[6]] [1] "TotalTimeSeconds" > xpathApply(doc2, "//TotalTimeSeconds", xmlValue) list() >
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
2009 Dec 03
3
Scraping a web page
I would like to be able to submit a list of URLs of various webpages and extract the "content" i.e. not the mark-up of those pages. I can find plenty of examples in the XML library of extracting links from pages but I cannot seem to find a way to extract the text. Any help would be greatly appreciated - I will not know the structure of the URLs I would submit in advance. Any
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 tables looks like this: > > [1] "<body><html><table&g...
2011 Jul 10
1
Help with tryCatch
Having a hard time understanding the help files for tryCatch. Looking for a little help with the following statement which sits inside a for loop zest[i] <- tryCatch(sapply(getNodeSet(zdoc, "//zestimate/amount"), xmlValue), error=function() zest[i] <-"NA") zest is a numeric vector If the sapply statement evaluates to an error, I'd like to set the value of zest[i] to NA and continue with the loop. Suggestions ? -- View this message in context: http://r.789695.n4.nabble.com/Help-with-tryCatch-tp3...
2012 Apr 12
3
Remove superscripts from HTML objects
Is there some way to remove superscripts from objects returned by html/xmlParse (XML package)? h <- "<html><p>Cat<sup>a</sup></p><p>Dog</p></html>" doc <- htmlParse(h) xpathSApply(doc, "//p", xmlValue) [1] "Cata" "Dog" I could probably remove the <sup> tags from the "h" object above, but I'd rather just work with the results from htmlParse if possible (and not use readLines to load raw HTML first). Thanks, Chris Stubben -- View this message in cont...
2012 Jun 06
1
Process XML files
...ing R's XML librariy. Thank you, Rxperts! I know there are libraries like XML and SPXML available in S-Plus. Could anyone please share examples of reading an xml file and save the contents in a data frame? Are there Splus equivalents of "getNodeSet", "xmlSApply" and "xmlValue"? Thanks so much! Santosh [[alternative HTML version deleted]]
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
2011 Oct 10
1
Text Mining with Facebook Reviews (XML and FQL)
...om review where message LIKE %',Qword,'%',sep='') Facebook_url = paste('https://api.facebook.com/method/fql.query?query= ',QUERY,sep='') mydata.xml <- xmlParseDoc(Facebook_url, asText=F) mydata.vector <- xpathSApply(mydata.xml, '//s:entry/s:title', xmlValue, namespaces =c('s'='http://www.w3.org/2005/Atom')) The mydata.xml is NULL therefore no further step can be execute. I am not so familiar with XML or FQL. Any suggestion will be appreciated. Thank you! Best regards, Kenneth [[alternative HTML version deleted]]
2009 Mar 02
2
Need help extracting info from XML file using XML package
...ike 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 <- xmlValue(docroot[[52]][[3]][[7]][[3]][[3]][[1]][[1]]) but this is hardly general! I'm hoping there is some relatively straightforward way to use functions from the XML package to recursively descend the structure and return the text strings representing the polygons into, say, a list with as many...
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
2010 Jul 03
1
XML and RCurl: problem with encoding (htmlTreeParse)
...ibrary(XML) >theurl <- "http://home.sina.com" >download.file(theurl, "tmp.html") >txt <- readLines("tmp.html") >txt <- htmlTreeParse(txt, error=function(...){}, useInternalNodes = TRUE) >g <- xpathSApply(txt, "//p", function(x) xmlValue(x)) >head(grep(" ", g, value=T)) [1] " | | ENGLISH" " " [3] " ()" " " [5] " " " ! ! !" SecondMethod:- >library(RCurl) >theurl...