ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: Editing an XML file using ant
Date Wed, 19 Sep 2007 22:30:31 GMT
On 9/19/07, broken connection <brokenconnection@gmail.com> wrote:
> Can someone please suggest anyway to resolve this?? This is strange.

<web-app xmlns="http://java.sun.com/xml/ns/javaee">
<web-app>

Are two different XML elements. The first belongs to an XML namespace,
the second doesn't. XSL is namespace-aware, and thus won't match
<web-app xmlns="http://java.sun.com/xml/ns/javaee"> when you tell it
to match <web-app>, and vice versa.

You could match both, but the problem is that the elements you want to
insert need to belong to the "proper" namespace too. <web-app
xmlns="http://java.sun.com/xml/ns/javaee"> not only says that the
'web-app' element belongs to the "http://java.sun.com/xml/ns/javaee"
namespace, it also sets the "default" namespace. This means that all
elements enclosed in 'web-app' also belong to this namespace, while
the elements you want to insert, coming from another XML file, also
belong to some namespace. XSL doesn't do a "textual" insert, but a
"namespace-aware" insert in this case.

Sorry if the above is confusing. XSL and XML namespaces both have a
learning curve to them. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message