merging xml files

Discussion in 'XML' started by Nathan Coast, Oct 26, 2004.

  1. Nathan Coast

    Nathan Coast Guest

    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
     
    Nathan Coast, Oct 26, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe
    Replies:
    0
    Views:
    419
  2. Stefan Franke

    merging two XML files

    Stefan Franke, Jan 4, 2005, in forum: XML
    Replies:
    5
    Views:
    780
    Joris Gillis
    Jan 4, 2005
  3. Replies:
    2
    Views:
    17,406
    Philippe Poulard
    Aug 24, 2006
  4. Replies:
    5
    Views:
    581
    Jerry Coffin
    Sep 24, 2006
  5. Tine Müller
    Replies:
    3
    Views:
    377
    Tine Müller
    Apr 30, 2008
Loading...

Share This Page