Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XML doc update -remove a node

843834Jun 24 2010 — edited Jun 30 2010
Hello,
I have faced some problem while updating an xml document. The xml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<EmployeeDetailList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../schema/EmployeeDetail.xsd">
<Version versionId="2.17" />
<Employee Id="1023">
<FirstNm name="DAVID">
<Salary sal="10000" />
<Account no="00423157" />
</RoutingEvent>
</FirstNm>
</Employee>
<Employee Id="1037" />
</EmployeeDetailList>

Now I need to update this document by deleting the <Employee Id="1023"> tag from each set. It will look like:

<?xml version="1.0" encoding="UTF-8"?>
<EmployeeDetailList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../schema/EmployeeDetail.xsd">
<Version versionId="2.17" />
<FirstNm name="DAVID">
<Salary sal="10000" />
<Account no="00423157" />
</RoutingEvent>
</FirstNm>
</EmployeeDetailList>

But I could not find a proper way/method to do so. Please help.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2010
Added on Jun 24 2010
6 comments
155 views