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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -