title: In DataStage, how do you extract an element together with a list of elements from an XML file
body: <p>so I've spent hours trying to figure this out. I'm basically trying to read an xml document (using the Hierarchical Data stage). Then I need to output the contents of that document into a dataset with two columns. </p>
  
  <p>The difficulty is that in the xml document I read from an element and then I need to read from a list of elements; Specifically productID and SubjectCode.</p>
  
  <p><a href="https://i.stack.imgur.com/R5TUq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R5TUq.png" alt="Content of XML file to read"></a></p>
  
  <p>The output I need is this </p>
  
  <p><a href="https://i.stack.imgur.com/sPhF3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sPhF3.png" alt="Output I&#39;d like to get"></a></p>
  
  <p>But I'm getting the following error because DataStage doesn't want to associate a single element  with a multiple list element .  </p>
  
  <p><a href="https://i.stack.imgur.com/0j3u2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0j3u2.png" alt="Error from DataStage"></a></p>
  
  <p>I should mention that if subjectCode was a single element like productID, it works fine. Any ideas would be appreciated.</p>