How to use XOM to query and manipulate XML tags converted from srcml

145 Views Asked by At

Please bear with me. I am newbie to parsing. I want to use XOM to query an xml document and modify the code. Example -

<expr_stmt><expr><name>x_int</name><operator>=</operator><literal type="number">10</literal></expr>;</expr_stmt>

 <expr_stmt><expr><name>x_char</name><operator>=</operator><literal type="char">'t'</literal></expr>;</expr_stmt>
<expr_stmt><expr><name>x_double</name><operator>=</operator><literal type="number">1.4</literal></expr>;</expr_stmt>

So I want to use XOM to query the doc and add an output line after every assignment statement. Please bear in mind that you are talking to java, xml, parsing beginner ... so just take it step-by-step .... how to start xom and query xml documents and add statements

0

There are 0 best solutions below