java using XPath from xml to xml generation
Hi
I am having xml as input feed, need to look for particular kind of elements, these type element may be more then one in a given document.
then extract the attribute value, apply busicess logic using value, create element replace the old element with new.
e.g.
sample.xml
<root>
<introduction>This isfor testing</introduction>
<abstract>
this is elementforabstract
</abstract>
<content type='html'>
[b]<?AbcLink id='100'?>[/b] Dummy <a href='www.yahoo.com'>content</a> that the <a href='www.google.com'>cross</a>
linking tool will manipulate
</content>
<copyright>some dummy info</copyright>
[b]<removed>200</removed>[/b]
</root>
expected out file
sample.xml
<root>
<introduction>This isfor testing</introduction>
<abstract>
this is elementforabstract
</abstract>
<content type='html'>
[b]<?DefLink id='100' name='xxx' location ='yyy'?>[/b] Dummy <a href='www.yahoo.com'>content</a> that the <a href='www.google.com'>cross</a>
linking tool will manipulate
</content>
<copyright>some dummy info</copyright>
</root>
i would like to do this with java with Xpath, able to get the value of element attribute but how to replace element & deletion of element <removed>.
Any sample code helps me great !
Thanks & Regards
vittal

