0

I only want app_id of "Rahul2 test".

I am not storing this xml in file, how can I get it?

Code:

String s=resultWrapper.getAppBuilds();      
System.out.println(s);

Output:

<application app_name="Rahul1 Test" app_id="18" >
<customfield name="Custom 1" value=""/>
<customfield name="Custom 2" value=""/>
<customfield name="Custom 3" value=""/>
<customfield name="Custom 4" value=""/>
<customfield name="Custom 5" value=""/>
<customfield name="Custom 6" value=""/>
<customfield name="Custom 7" value=""/>
<customfield name="Custom 8" value=""/>
<customfield name="Custom 9" value=""/>
<customfield name="Custom 10" value=""/>
<build version>
</build>
</application>
<application app_name="Rahul2 Test" app_id="196" >
<customfield name="Custom 1" value=""/>
<customfield name="Custom 2" value=""/>
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
rahul
  • 75
  • 1
  • 10

1 Answers1

0

convert the String to DOM xml ( https://stackoverflow.com/a/3906936/58082 ) and then use XPATH to get the property ( How to get attribute value using XPath in Java? )

Community
  • 1
  • 1
Pierre
  • 34,472
  • 31
  • 113
  • 192