> Resent due to errant bounces :-(
>
> Brian Agnew wrote:
>> If you can write that property out as a file, then XMLTask can read it
>> as
>> normal. Or you can make use of the file:// notation for defining
>> persisted
>> buffers in XMLTask.
>>
>> You could instead create an in-memory XML doc using properties thus:
>>
>> <xmltask>
>> <insert path="/">
>> <![CDATA[
>>  ${your.property}
>> ]]>
>> </insert>
>> </xmltask>
>>
>> Note how I've not defined a source or dest here.
>>
>> Brian
>>
>> On Thu, October 4, 2007 17:06, Holger Rauch wrote:
>>
>>> Hi,
>>>
>>> I'm using Saxon's XQuery implementation to extract XML fragments from
>>> an
>>> XML
>>> document since XPath 1.0 is not powerful enough for this purpose.
>>> The macro invokes java on class net.sf.saxon.Query and stores the
>>> result in a property. The value of the property xmldoc.mods2build.core
>>> is
>>> correct.
>>>
>>> I then would like to use <xmltask>,<call>,<actions> in order to build
>>> property values (a module list consisting of module names separated by
>>> spaces). So my question is: How can tell xmltask to use the value of
>>> the
>>> property xmldoc.mods2build.core as input for an internal xmltask buffer
>>> from
>>> which I can further select attributes and use the <call> and <actions>
>>> elements?
>>>
>>> I'm using Ant 1.7.0 in conjunction with xmltask 1.15.1.
>>>
>>> Thanks in advance for any help!
>>>
>>> I got an xquery macro defined like this:
>>>
>>> =================================================
>>>
>>> <macrodef name="xquery">
>>>      <attribute name="xqueryexpr" default="NOT SET" />
>>>      <attribute name="outputprop" default="NOT SET" />
>>>      <attribute name="errorprop" default="NOT SET" />
>>>      <sequential>
>>>        <if>
>>>      <not>
>>>        <equals arg1="@{errorprop}"
>>>                arg2="NOT SET"
>>>                casesensitive="false" />
>>>      </not>
>>>      <then>
>>>        <java fork="true"
>>>              outputproperty="@{outputprop}"
>>>              errorproperty="@{errorprop}"
>>>              classname="net.sf.saxon.Query"
>>>              classpathref="saxon8.classpath">
>>>          <jvmarg line="${env.ANT_OPTS}" />
>>>          <arg line="-pull -t @{xqueryexpr}" />
>>>        </java>
>>>      </then>
>>>      <else>
>>>        <java fork="true"
>>>              outputproperty="@{outputprop}"
>>>              classname="net.sf.saxon.Query"
>>>              classpathref="saxon8.classpath">
>>>          <jvmarg line="${env.ANT_OPTS}" />
>>>          <arg line="-pull -t @{xqueryexpr}" />
>>>        </java>
>>>      </else>
>>>        </if>
>>>      </sequential>
>>>    </macrodef>
>>>
>>> ==========================================================
>>>
>>> I invoke the macro like this:
>>>
>>> ===========================================================
>>>
>>> <xquery xqueryexpr="&quot;{for $$i in 1 to
>>> max(doc('${workspace.root}/empic-suite/resources/GlobalSetup-resolved.xml')//[EMAIL
>>>  PROTECTED]/xs:integer(@build-order))
>>> return
>>> doc('${workspace.root}/empic-suite/resources/GlobalSetup-resolved.xml')//[EMAIL
>>>  PROTECTED]
>>> not(@virtual) and @base-set=1]}&quot;"
>>>         outputprop="xmldoc.mods2build.core" />
>>>
>>> ===========================================================
>>>
>>> The result looks like this:
>>>
>>> ===========================================================
>>>
>>> <?xml version="1.0" encoding="UTF-8"?><module id="mod-heitec.core"
>>> base-set="1" build-order="1"><name lang="en">HEITEC
>>> CORE</name><resource-list svn-base-dir="heitec"/></module><module
>>> id="mod-heitec.2jee.core" base-set="1" build-order="2"><name
>>> lang="en">HEITEC J2EE CORE</name><resource-list
>>> svn-base-dir="heitec-j2ee-core"/></module><module id="mod-cache"
>>> base-set="1" build-order="3"
>>> persisted="1"><shortname>CACHE</shortname><name
>>> lang="en">CACHE</name><resource-list
>>> svn-base-dir="cache"/></module><module
>>> id="mod-sec" eap-id="2" base-set="1" build-order="4" persisted="1"
>>> gui="1"><comment>Security, Permission Management to all
>>> Modules</comment><shortname>SEC</shortname><name
>>> lang="en">SECURITY</name></module><module id="mod-ce" eap-id="99"
>>> base-set="1" build-order="5" catalog="1" persisted="1"
>>> gui="1"><shortname>CE</shortname><name
>>> lang="en">CENTRAL</name><resource-list svn-base-dir="central"><resource
>>> type="xph-caption-defines">???</resource><resource
>>> type="catalog-defines">src/de/heitec/empic/service/catalogs/model/vo/CatalogDefines.java</resource></resource-list></module><module
>>> id="mod-qs" eap-id="9" base-set="1" build-order="6" persisted="1"
>>> gui="1"><shortname>QS</shortname><name
>>> lang="en">QuerySynthesizer</name></module><module id="mod-cm"
>>> eap-id="1"
>>> base-set="1" build-order="7" catalog="1" persisted="1"
>>> gui="1"><shortname>CM</shortname><name lang="en">Customer
>>> Management</name><name lang="de">Kundenverwaltung</name><resource-list
>>> svn-base-dir="cm"><resource type="xph-caption-defines"
>>> param="CMHistoryConstants">src/de/heitec/empic/admin/model/vo/CMHistoryConstants.java</resource></resource-list></module>
>>>
>>> ===========================================================
>>>
>>> Kind regards,
>>>
>>>     Holger
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Splunk Inc.
>>> Still grepping through log files to find problems?  Stop.
>>> Now Search log events and configuration files using AJAX and a browser.
>>> Download your FREE copy of Splunk now >>
>>> http://get.splunk.com/_______________________________________________
>>> 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         brian @ oopsconsultancy.com
> Tel: +44 (0)7720 397526
> Fax: +44 (0)20 8682 0012
>
>


-- 
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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Xmltask-users mailing list
Xmltask-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmltask-users

Reply via email to