Sorry for taking so long to reply. I've not tried this with 1.4 but have confirmed your results with Java 5. The XML within the CDATA section you're loading doesn't have a namespace defined, so I suspect that's why you end up with:
xmlns="" If you change the XML you insert to: <![CDATA[<resource-ref xmlns="http://java.sun.com/xml/ns/j2ee" id="DSNAME_1"> .... i.e. specify the xmlns, then you get the original behaviour (and what I'd believe to be correct). I'm increasingly thinking that XMLTask needs to be able to inherit a namespace from an original document and then use that for all future inserts, since a number of issues have come up surrounding this. If you (or anyone else) has any views on this, then please let me know. Brian Mahmut Eren wrote: > Hi, > > I've been using xmltask in jdk1.4 with no problem. > > When i upgraded to java 5 i saw that xmltast adds xmlns attributes with > empty values which causes problems in application server and app never > deploys. > > an example : > > <xmltask source="web.xml" dest="web2.xml"> > <insert path="*"> > <![CDATA[<resource-ref id="DSNAME_1"> > <res-ref-name>DSNAME</res-ref-name> > <res-type>javax.sql.DataSource</res-type> > <res-auth>Container</res-auth> > </resource-ref>]]> > </insert> > </xmltask> > > was adding with jdk 1.4 : > <resource-ref id="DSNAME_1"> > <res-ref-name>DSNAME</res-ref-name> > <res-type>javax.sql.DataSource</res-type> > <res-auth>Container</res-auth> > </resource-ref> > > now adds with java 5 : > <resource-ref id="DSNAME_1" xmlns=""> > <res-ref-name>DSNAME</res-ref-name> > <res-type>javax.sql.DataSource</res-type> > <res-auth>Container</res-auth> > </resource-ref> > > it's a web.xml file with header: > <web-app xmlns="http://java.sun.com/xml/ns/j2ee" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> > > > > thanks in advance. > > mahmut > > > > ==========================================================- > Bu e-posta sadece yukarida isimleri belirtilen kisiler arasinda özel > haberlesme amacini tasimaktadir. Size yanlislikla ulasmissa lütfen gönderen > kisiyi bilgilendiriniz ve mesaji sisteminizden siliniz. Turkiye Cumhuriyet > Merkez Bankasi A.S. bu mesajin icerigi ile ilgili olarak hicbir hukuksal > sorumlulugu kabul etmez. > > This e-mail communication is intended for the private use of the people named > above. If you received this message in error, please immediately notify the > sender and delete it from your system. The Central Bank of The Republic of > Turkey does not accept legal responsibility for the contents of this message. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Xmltask-users mailing list > Xmltask-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/xmltask-users > -- Brian Agnew http://www.oopsconsultancy.com OOPS Consultancy Ltd Tel: +44 (0)7720 397526 Fax: +44 (0)20 8682 0012 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Xmltask-users mailing list Xmltask-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xmltask-users