title: Parsing XML into an R data frame
body: <p>Im stuck trying to parse a big xml-file into an R - data.frame object. The xml has the following schema:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;?eclipse version="3.0"?&gt;
    &lt;ROOT&gt;
    &lt;row&gt;
      &lt;field name="dtcreated"&gt;&lt;/field&gt;
      &lt;field name="headline"&gt;&lt;/field&gt;
      &lt;subheadline/&gt;
      &lt;field name="body"&gt;&lt;/field&gt;
    &lt;/row&gt;
    &lt;row&gt;
      &lt;field name="dtcreated"&gt;&lt;/field&gt;
      &lt;field name="headline"&gt;&lt;/field&gt;
      &lt;subheadline/&gt;
      &lt;field name="body"&gt;&lt;/field&gt;
    &lt;/row&gt;
  &lt;/ROOT&gt;
  </code></pre>
  
  <p>the plyr convenience functions didn't help, since the xml couldn't be validated. So I came up with the following code, using xpath queries:</p>
  
  <pre><code>adHocXml&lt;-xmlTreeParse(adHocXmlPath,getDTD = FALSE)
  adHocRoot&lt;-xmlRoot(adHocXml)
  creationDateColumn&lt;-sapply(getNodeSet(adHocRoot,"//row//field[@name='dtcreated']"), xmlValue)
  headlineColumn&lt;-sapply(getNodeSet(adHocRoot,"//row//field[@name='headline']"), xmlValue)
  bodyColumn&lt;-sapply(getNodeSet(adHocRoot,"//row//field[@name='body']"), xmlValue)
  adHocData&lt;-data.frame(creationDate=creationDateColumn,headline=headlineColumn,body=bodyColumn)
  </code></pre>
  
  <p>The code does exactly what I expect it to do for a short file. With a large file and several thousand row-tags however, I get the following error after about 10 minutes:</p>
  
  <pre><code>Error: 1: internal error: Huge input lookup
  2: Extra content at the end of the document 
  </code></pre>
  
  <p>Can anyone help me?</p>