About
Pricing
Community
Teams
Start Free Trial
Log in
myjobiscoding
asked on
6/30/2012
java - add an element to XML documnet
I know how to remove the element using xpath like below, but dont know how to add an new element. Please advise
For example, I use the following to remove the element using xpath
elem = getElements("./student:enr
olment", std);
elem.detach();
Now I want to add the enrolled course to the element <./student:enrolment", std);
i want to add the following element
<std1:enrollendCourse>
<std1:course>Law</std1:cou
rse>
</std1:enrollendCourse>
please advise
Java
1
1
Last Comment
Manikandan Thiagarajan
8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Manikandan Thiagarajan
6/30/2012
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes