1

At Runtime I will get a XSD , XML , Xpath expression , and a element. I have to add this element to the xml under the element specified by xpath expression . If Element pointed by xpath expression is sequenced then I have to add the element in its correct Position. How can I achieve that in Java?

1 Answer 1

0

XQuery Update looks like what you need. It allows you to say for example

insert node <a>something</a> as first|last into /doc/section[2]/para[3]

There are a number of XQuery Update processors that can be invoked from Java, for example Saxon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.