Hi, the examples related to <call path="..." /> with nested <param path="..." /> elements given in the XMLTask documentation imply that one may only use the <param path="..." to specify attributes contained in the element selected by <call path="..." />. Is that true?
The following example works:
==============================
<xmltask source="web.xml">
<call path="web/servlet"/>
<param name="id" path="@id" default="NO ID"/>
<actions>
<echo>Found a servlet @{id}</echo>
<!-- perform deployment actions -->
....
</actions>
</call>
</xmltask>
==============================
In this example, the id attribute is contained in the web/servlet element
selected by <call path="web/servlet"/>.
My example, however, doesn't work. The error message I get from ant is
xmltest-read.xml:148: required attribute eararchs not set
===================================
<xmltask>
<insert path="/"><![CDATA[${partner.mod.resources}]]></insert>
<call path="//resource-list">
<param name="svnbasedir" path="@svn-base-dir" />
<param name="eararchs" path="[EMAIL PROTECTED]'java-archive' and
@param='ear']" />
<param name="wararchs" path="[EMAIL PROTECTED]'java-archive' and
@param='war']" />
<param name="warresources" path="[EMAIL PROTECTED]'icon' and
@param='war']" />
<actions>
<echo message="svnbasedir = @{svnbasedir}" />
<echo message="eararchs = @{eararchs}" />
<echo message="wararchs = @{wararchs}" />
<echo message="warresources = @{warresources}" />
</actions>
</call>
</xmltask>
====================================
The property named parter.mod.resources contains this complete XML document
which is the result of an XQuery (sorry for the unindented formatting):
====================================
<?xml version="1.0" encoding="UTF-8"?>
<result:sequence xmlns:result="http://saxon.sf.net/xquery-results"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<result:element>
<resource-list svn-base-dir="ruag-hv">
<resource type="java-archive" param="ear">server/*.jar</resource>
<resource type="java-archive" param="ear">server/*.war</resource>
<resource type="java-archive" param="war">client/hv.jar</resource>
<resource type="icon" param="war">ruag_logo.gif</resource>
</resource-list>
</result:element>
</result:sequence>
====================================
The main difference compared to the examples in the documentation I notice
is that I try to select nodes that are not contained directly in the
<resource-list> element, but rather nodes that are *children* of that
element (such as the <resource> element). What's wrong with using <param
path="..." /> in this way?
Is the only workaround I can use something similar to
===============================
<xmltask>
<insert path="/"><![CDATA[${partner.mod.resources}]]></insert>
<call path="//resource-list">
<param name="svnbasedir" path="@svn-base-dir" />
<actions>
<echo message="svnbasedir = @{svnbasedir}" />
</actions>
</call>
<call path="//resource-list/[EMAIL PROTECTED]'java-archive' and
@param='ear']">
<param name="eararchs" path="text()" />
<actions>
<echo message="eararchs = @{eararchs}" />
</actions>
</call>
<call path="//resource-list/[EMAIL PROTECTED]'java-archive' and
@param='war']">
<param name="eararchs" path="text()" />
<actions>
<echo message="wararchs = @{wararchs}" />
</actions>
</call>
<call path="//resource-list/[EMAIL PROTECTED]'icon' and @param='war']">
<param name="warresources" path="text()" />
<actions>
<echo message="warresources = @{warresources}" />
</actions>
</call>
</xmltask>
===============================
Thanks in advance for any info!
Kind regards,
Holger
signature.asc
Description: Digital signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ Xmltask-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xmltask-users
