Nathan Coast
Usenet Archive
- Joined
- Oct 26, 2004
- Messages
- 3
- Reaction score
- 0
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
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