Imagine this XML:
<DocumentElement>
<PropsAndValues>
<Name># CONFIGURATION_NODE # DO NOT DELETE THIS ROW #</Name>
<Keywords>#</Keywords>
<Tests>#</Tests>
<Type>#</Type>
</PropsAndValues>
<PropsAndValues>
<Name>PersonSuiteTC-1</Name>
<Keywords/>
<Tests>Definition:"Business Process":PersonSuiteTC-1</Tests>
<Type>HIGH</Type>
</PropsAndValues>
<PropsAndValues>
<Name>No Operation</Name>
<Keywords/>
<Tests/>
<Type>TECH</Type>
</PropsAndValues>
<PropsAndValues>
<Name>Start</Name>
<Keywords>No Operation</Keywords>
<Tests/>
<Type>LOW</Type>
</PropsAndValues>
<PropsAndValues>
<Name>Open Application</Name>
<Keywords>No Operation</Keywords>
<Tests/>
<Type>LOW</Type>
</PropsAndValues>
<PropsAndValues>
<Name>Go To Profile Finder</Name>
<Keywords>No Operation</Keywords>
<Tests/>
<Type>LOW</Type>
</PropsAndValues>
<PropsAndValues>
<Name>Search Person</Name>
<Keywords>No Operation</Keywords>
<Tests/>
<Type>LOW</Type>
</PropsAndValues>
<PropsAndValues>
<Name>End</Name>
<Keywords>No Operation</Keywords>
<Tests/>
<Type>LOW</Type>
</PropsAndValues>
<PropsAndValues>
<Name>PersonSuiteTC-1</Name>
<Keywords>
Start Open Application Go To Profile Finder Search Person End
</Keywords>
<Tests/>
<Type>HIGH</Type>
</PropsAndValues>
</DocumentElement>
I need to create a method with this header:
private static void addRelation(String kWName, String elemName) throws Exception {
}
that adds elemName to the tag <Keywords>
of a Node that has <Name>
tag value the kwName.
For example:
addRelation("PersonSuiteTC-1", "Add this String to <Keywords> tag")
, should go to the node with the name "PersonSuiteTC-1" and add "Add this String to tag" to the <Keywords>
tag.
What's the easiest way to do it?
Thanks.