Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#16 Insert does not work for xml with namespace

open
nobody
None
5
2014-11-08
2010-02-17
Dave Wang
No

We tried to insert nodes under web-app, it did not work. Nothing happened without error message.

<xmltask source="web.xml" dest="web.xml">
<insert path="/web-app" position="under">
<![CDATA[
<node />
]]>
</insert>
</xmltask>

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
...
</web-app>

if the namespace declarations are removed from <web-app>, it worked.
<web-app>
...
</web-app>

Discussion

  • Brian Agnew
    Brian Agnew
    2010-02-27

    This is a common source of confusion and should be addressed in a future version. The insert does work, but you're trying to insert a document with one namespace into that of another. You need to replicate the namespacing in the document you're trying to insert (i.e. the <node/>)