Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jlgalvan-ts opened this issue Aug 5, 2024 · 1 comment
Open

Comments

@jlgalvan-ts
Copy link

jlgalvan-ts commented Aug 5, 2024

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?

@jlgalvan-ts
Copy link
Author

Can someone help me with this question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant