[R] substituting XML tags with custom values
    filip 
    fbielejec at gmail.com
       
    Thu Mar 22 20:41:47 CET 2012
    
    
  
Hello,
I have an xml document with a following element:
<sequence id = "ancestralSequence"> 
    <taxon id="test">
     </taxon>       
    ACAGTTGACACCCTT
</sequence>
I would like to parse a new sequence of characters inside the "taxon"
tags. I started looking into XML package documentation, but cannot find
a simple solution yet. My code:
# load packages
require("XML")
# create a new sequence
newSeq <- "TGTCAATGGAACCTG"
# read the xml
xml <- xmlParse("epoch_mcmc.xml")
# save as character:
charXML <- saveXML(xml)
-- 
while(!suceed) { try(); }
    
    
More information about the R-help
mailing list