0

i have the following XML file :

<table1>
<row0>
    <column1>String</column1>
    <column2>int</column2>
</row0>

<row1>
    <column1>aa</column1>
    <column2>65432</column2>
</row1>

<row2>
    <column1>ww</column1>
    <column2>1111</column2>
</row2>

<row3>
    <column1>fff</column1>
    <column2>333</column2>
</row3>

<row4>
    <column1>jj</column1>
    <column2>2</column2>
</row4>

and if i have for example the value aa i want to get "row1" as a String what should i do?

1
  • What you have tried ? post some code Commented Nov 17, 2015 at 18:37

1 Answer 1

1

If you already have the column1 Element with the value aa and just want to get the name of the parent node, use col1Element.getParentNode().getNodeName().

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.