regex - How to combine XML via node attributes Java -


i have following xml example:

<template>    <text id="1">you don't qualify because</text>    <pertinentdatainputnodenamelistinline id="2">applicableconditions</pertinentdatainputnodenamelistinline>    <text id="3">.</text> </template> 

note: example, there more 3 children nodes of template. way know there sentence combined via id attribute.

how can combine (using regex or efficient approach) construct sentence perhaps using it's attributes in following manner: id1+id2+id3+...+idn. output should be:

you don't qualify becauseapplicableconditions.

notice attribute id every child of template node. or assistance appreciate.

edit:

removed code because it's distracting actual question.

instead of using regex, it's better use stripping tag function. dead simple jsoup.

public static string html2text(string html) {     return jsoup.parse(html).text(); } 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -