merging xml files

N

Nathan Coast

Hi,

I need to merge the contents of an xml file with xml elements that have
been generated into another file.

What I'm actually trying to do....

I'm updating the maven tomcat plugin. This plugin uses the tomcat jspc
to generate servlet classes for the jsps. the jspc also creates xml
elements for the servlets and servlet mappings. I need to merge this
generated xml snippet with the original web.xml for the web-application.

Problems I have is to merge the files without violating the
web-application schema

<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://java.sun.com/xml/ns/j2ee"
xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="2.4">

The difficulty comes as there's no guarantee what other elements will be
present in the original web.xml

I've had a look at JDom and dom4j and there doesn't seem to be an easy
way to do this.

Anyone have any ideas how to go about this? Additional constraints I
have are that the solution needs to work from java or ant.

any help much appreciated,

cheers
Nathan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,998
Messages
2,570,242
Members
46,834
Latest member
vina0631

Latest Threads

Top