merging xml files
Question posted by: Nathan Coast
(Guest)
on
July 20th, 2005 08:48 AM
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
0
Answers Posted
|
|
|
What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 197,026 network members.
Top Community Contributors
|