Displaying 16 results from an estimated 16 matches for "xmleventparse".
2005 Sep 21
5
SAX Parser best practise
Dear All,
I have a question regarding best practise in setting up a XML parser
within R.
Because I have files with more than 100 MB and I'm only interested in
some values I think a SAX-like parser using xmlEventParse() will be the
best solution.
Unfortunately the values I'm looking for, to construct some higher "mass
spectrum", are distributed over different lines: as <spectrum id="2">,
<mzArrayBinary>, <intenArrayBinary> <... name="MassToChargeRatio"
value...
2012 Oct 26
1
Parsing very large xml datafiles with SAX: How to profile <anonymous> functions?
...r
the <anonymous> label, and I get something like this:
$by.total
total.time total.pct self.time self.pct
"system.time" 151.22 99.99 0.00 0.00
"MyParsingFunction" 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...
2009 Feb 24
1
odfWeave problem "Error in xmlEventParse"
...lRM_PA_CY_SL_Fig)
46 : term verbatim(label=IPClassDistRelRM_PA_CY_SP_Fig)
47 : term xml(label=IPTrans_TS_SL_count)
48 :(label=IPTrans_TS_SP_count)
49 : term verbatim(label=close)
'content_1.xml' has been Sweaved
Removing content.xml
Post-processing the contents
Error in xmlEventParse(infile, handlers = handlers, trim = FALSE,
state = state) :
attempt to apply non-function
In addition: Warning message:
closing unused connection 3 (content.xml)
>
---------------------------------------------------------------
--
"Life is like a trumpet - if you don't put anythi...
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
2007 Sep 04
1
SOLVED: importing huge XML-Files -- new problem: special characters
Hi all,
thanks to the people who replied to my question! I finally solved the
issue by writing own handlers and using xmlEventParse - which leads
to the following problem which is so odd that its probably a bug.
I use several special charachter in my XML-File, e.g. umlauts or ? or
? - but no matter how I encode my XML (UTF or ISO) or I escape these
characters xmlEventParse always stops parsing after the first umlaut
an...
2012 Mar 21
1
Trouble installing the XML package
...-DDUMP_WITH_ENCODING=1
-DUSE_XML_VERSION_H=1 -DXML_ELEMENT_ETYPE=1 -DXML_ATTRIBUTE_ATYPE=1
-DNO_XML_HASH_SCANNER_RETURN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1
-DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1
-DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1 -I. -DLIBXML2=1 -fpic
-g -O2 -c XMLEventParse.c -o XMLEventParse.o
In file included from XMLEventParse.c:5:
Utils.h:230:2: warning: #warning "Redefining COPY_TO_USER_STRING to
use encoding from XML parser"
XMLEventParse.c: In function ?R_processBranch?:
XMLEventParse.c:349: warning: initialization from incompatible pointer type
gcc -...
2005 May 08
2
Extract just some fields from XML
...Now I want to extract only node 'pubdate' and its children, but I don't
know how to do that unless I try to dig into the structure of the XML
file. The problem is that structure can differ and then hardcoded set
of list indices i.e. tmp[[i]][[j]]... doesn't help me.
I've read xmlEventParse but I don't understand handlers part up to the
point that I could get anything usable from it. Here is something not
very usable ;)
PubDate <- function(x, ...)
{
print(x)
}
xmlEventParse(URL, isURL = TRUE,
handlers=list(PubDate=PubDate),
addConte...
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>
- <Data>
- <dataSets noOfDataSets="50000">
- <dataSet number="1">
- <measurements>
- <measurement number="1">
- <MRType1>...
2005 May 10
0
Fwd: Extract just some fields from XML]
...the the three PubDate elements in the document.
>
>If you wanted both PubDate and PubMedPubDate elements,
>you could use
>
> myHandlers = getElements(c("PubDate", "PubMedPubDate")
>
>[Note that XML is case-sensitive and pubdate won't work.]
>
>The xmlEventParse is quite a bit more work as it is for
>very low-level parsing, working at the parser level
>of opening and closing XML elements.
>
>The xmlTreeParse is a hybrid parser. It works at the higher
>level of nodes, but provides an opportunity to process
>nodes when they are "create...
2010 Nov 10
2
odfWeave/XML Windows issue
I am getting the following error when using odfWeave
Error in xmlEventParse(infile, handlers = handlers, trim = FALSE, state =
state) :
File content_1.xml does not exist
This appears to be the same issue detailed in
http://markmail.org/message/qsrqdtozizlngbrt#query:+page:1+mid:qsrqdtozizlngbrt+state:results
however the link to XML_1.93-2.3.zip appears to be dead....
2003 Sep 09
1
Building XML package for MacOS X
...NCDIR=/usr/local/include/libxml2. I use R INSTALL, I get the
following:
R INSTALL -c -l /usr/local/R/library XML_0.94-1.tar.gz
:
:
:
gcc -bundle -flat_namespace -undefined suppress -L/sw/lib -L/usr/local/lib
-o XML.so DocParse.o EventParse.o ExpatParse.o HTMLParse.o RSDTD.o
RUtils.o Utils.o XMLEventParse.o XMLTree.o -lz -lxml2
ld: multiple definitions of symbol _xmlParserError
Utils.o definition of _xmlParserError in section (__TEXT,__text)
/usr/local/lib/libxml2.dylib(libxml2.2.5.9.dylib-master.o) definition of
_xmlParserError
make: *** [XML.so] Error 1
ERROR: compilation failed for package '...
2012 Oct 13
0
XML_3.95-0.1.tar.gz does not build on FreeBSD
...URN=1 -DLIBXML_NAMESPACE_HAS_CONTEXT=1 -DHAVE_R_CETYPE_T=1 -DHAVE_XML_WITH_ZLIB=1 -DHAVE_XML_HAS_FEATURE=1 -DUSE_R=1 -D_R_=1 -DHAVE_VALIDITY=1 -DXML_REF_COUNT_NODES=1 -I. -DLIBXML2=1 -I/usr/local/include -fpic -O2 -pipe -O2 -fno-strict-aliasing -pipe -msse3 -Wl,-rpath=/usr/local/lib/gcc46 -c XMLEventParse.c -o XMLEventParse.o
In file included from XMLEventParse.c:5:0:
Utils.h:230:2: warning: #warning "Redefining COPY_TO_USER_STRING to use encoding from XML parser" [-Wcpp]
XMLEventParse.c: In function 'R_processBranch':
XMLEventParse.c:351:20: warning: initialization from incompatib...
2003 Oct 09
2
building XML-0.95-1 on MacOS
...ibxml -DLIBXML -I/sw/include/gnome-xml
Link flags: -L/sw/lib -lxml -lz -lz -lxml
Compiling produced the following error:
gcc -bundle -flat_namespace -undefined suppress -L/sw/lib
-L/usr/local/lib -o XML.so DocParse.o EventParse.o ExpatParse.o
HTMLParse.o RSDTD.o RUtils.o Utils.o XMLEventParse.o XMLTree.o
-L/sw/lib -lxml -lz -lz -lxml -lcc_dynamic
ld: multiple definitions of symbol _xmlParserError
Utils.o definition of _xmlParserError in section (__TEXT,__text)
/sw/lib/libxml.dylib(error.lo) definition of _xmlParserError
make: *** [XML.so] Error 1
ERROR: compilation failed for package...
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",
2017 Jan 20
4
Problema con un xml demasiado Grande
Hola, muy buenas,
Me bajé un archivo xml de la wikipedia en español. Al intentar abrirlo
en R el ordenador no es capaz, ya que pesa descomprimido 10 GB. De ese
xml solo me interesa un campo, el referente al texto del artículo.
¿Alguiém conoce alguna forma de cargar solo ese campo del xml en R sin
cargar el xml completo? La salida seria un archivo .txt, donde cada fila
fuera un artículo ó
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