S
shirantha
Hi, Fellas
I have a problem regarding an Xml document, where I need to remove
blocks of xml code, if
there are control characters found in a block. (you know those squares
that sometimes appear). Of course i need to manipulate the code using
Java API's
What i want to do is when i find a control character (which could come
anywhere inside a
client node), I want to remove the entire client block from the
document and return it as a
string in a java class. In the example code below Two <client> blocks
contain control characters, so those blocks has to be removed.
I really cant think of an efficient way to do this. an Xml document may
contain several hundreds of such client node blocks.
Please, if any of u guys can think of mechanism it would be of great
help
Example Xml code
<...>
<client>
<name>Charles Darwin页页页</name>
<address>32, Vincent Av, London</address>
<info>Bill Lawry</info>
</client>
<client>
<name>Richie Benaud</name>
<address>32, Vincent Av, London</address>
<info>Some information goes here</info>
</client>
<client>
<name>Bill Lawry页页</name>
<address>32, Vincent Av, London</address>
<info>Some information goes here</info>
</client>
<client>
<name>Mark Waugh</name>
<address>32, Vincent Av, London</address>
<info>Some information goes here</info>
</client>
<...>
Appreciate your time
Thanks
Shiran.
I have a problem regarding an Xml document, where I need to remove
blocks of xml code, if
there are control characters found in a block. (you know those squares
that sometimes appear). Of course i need to manipulate the code using
Java API's
What i want to do is when i find a control character (which could come
anywhere inside a
client node), I want to remove the entire client block from the
document and return it as a
string in a java class. In the example code below Two <client> blocks
contain control characters, so those blocks has to be removed.
I really cant think of an efficient way to do this. an Xml document may
contain several hundreds of such client node blocks.
Please, if any of u guys can think of mechanism it would be of great
help
Example Xml code
<...>
<client>
<name>Charles Darwin页页页</name>
<address>32, Vincent Av, London</address>
<info>Bill Lawry</info>
</client>
<client>
<name>Richie Benaud</name>
<address>32, Vincent Av, London</address>
<info>Some information goes here</info>
</client>
<client>
<name>Bill Lawry页页</name>
<address>32, Vincent Av, London</address>
<info>Some information goes here</info>
</client>
<client>
<name>Mark Waugh</name>
<address>32, Vincent Av, London</address>
<info>Some information goes here</info>
</client>
<...>
Appreciate your time
Thanks
Shiran.