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=""/>

1 Answer 1

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? )

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.