omegahat / XML

The XML package for R
Other
20 stars 11 forks source link

Inconsistent conversion for xmlToList #1

Open krlmlr opened 10 years ago

krlmlr commented 10 years ago

The conversion of XML documents to lists using xmlToList is inconsistent. An XML document of the following format:

<h>
  <i>
    <s>1</s>
    <s>1</s>
    <s>1</s>
  </i>
  <j>
    <s>2</s>
    <s>2</s>
  </j>
</h>

is converted in three different ways depending on the exact number of <s> elements under the <i> and <j> elements. A reproducible example, along with an implementation that works as expected, can be found on Rpubs.

This issue also has popped up on StackOverflow some time ago.