streamthoughts/kafka-connect-file-pulse

Get Node Name while processing XML with reader.xpath.expression

jlgalvan-ts opened this issue · 1 comments

I have a XML file similar to:

<MasterNode>
   <NodeType1 attb1="a" attbr2="b" />
   <NodeType2 attb1="a" attbr2="c" />
   <NodeType1 attb1="a" attbr2="c" />
</MasterNode>

And I want to process only NodeTypeX nodes, and for that I use 'reader.xpath.expression' = '/MasterNode/*'. It's Ok but I want to add NodeName as a new attribute.

For example, for first NodeType:

{
  'attbr1'='a',
  'attbr2'='b',
  'nodename'='NodeType1'
}

How Can I get Node Name when I use reader.xpath.expression?

Can someone help me with this question?