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

[2195 byte] By [vittal.reddya] at [2007-11-27 4:54:59]
# 1
XPath is a read-only technology. You can use XSLT to "transform" an XML document. Seems that it would work for you in this case.
spericasa at 2007-7-12 10:09:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...