How To : Parse sibling repeating groups without wrapper element

Long time no post, so here’s a new (short) article.
Behind the cryptic title lies a situation like this :

<root>
  <id>1</id>
  <name>SMITH</name>
  <id>2</id>
  <name>WILSON</name>
  <id>3</id>
  <name>GRANT</name>
</root>

where each logical record {id, name} is not enclosed by a row tag.
This is the result we want out of that data :

ID    NAME
----- ---------
    1 SMITH
    2 WILSON
    3 GRANT

 

Continue reading