## Re: [Xmltask-users] Using a property value as input source for a buffer

 Re: [Xmltask-users] Using a property value as input source for a buffer From: Holger Rauch - 2007-10-05 16:08:34 Attachments: Message as HTML ```Hi Brian, first of all, thanks for your quick reply. What's different from your test is that my property contains a complete XML document (see below). Any idea? Thanks in advance for any info! Kind regards, Holger =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ; HEITEC CORE HEITEC J2EE CORE CACHE CACHE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > [...]=20 > which works out of the box. Does your property evaluate to XML with a root > node ? ```

 [Xmltask-users] Using a property value as input source for a buffer From: Holger Rauch - 2007-10-04 16:06:29 Attachments: Message as HTML ```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 ,, 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 and 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: ================================================= ========================================================== I invoke the macro like this: =========================================================== =========================================================== The result looks like this: =========================================================== HEITEC COREHEITEC J2EE CORECACHECACHESecurity, Permission Management to all ModulesSECSECURITYCECENTRAL???src/de/heitec/empic/service/catalogs/model/vo/CatalogDefines.javaQSQuerySynthesizerCMCustomer ManagementKundenverwaltungsrc/de/heitec/empic/admin/model/vo/CMHistoryConstants.java =========================================================== Kind regards, Holger ```
 Re: [Xmltask-users] Using a property value as input source for a buffer From: Brian Agnew - 2007-10-05 13:56:14 ```> 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: >> >> >> >> > \${your.property} >> ]]> >> >> >> >> 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 ,, 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 and >>> 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: >>> >>> ================================================= >>> >>> >>> >>> >>> >>> >>> >>> >>> >> arg2="NOT SET" >>> casesensitive="false" /> >>> >>> >>> >> outputproperty="@{outputprop}" >>> errorproperty="@{errorprop}" >>> classname="net.sf.saxon.Query" >>> classpathref="saxon8.classpath"> >>> >>> >>> >>> >>> >>> >> outputproperty="@{outputprop}" >>> classname="net.sf.saxon.Query" >>> classpathref="saxon8.classpath"> >>> >>> >>> >>> >>> >>> >>> >>> >>> ========================================================== >>> >>> I invoke the macro like this: >>> >>> =========================================================== >>> >>> >> outputprop="xmldoc.mods2build.core" /> >>> >>> =========================================================== >>> >>> The result looks like this: >>> >>> =========================================================== >>> >>> >> base-set="1" build-order="1">HEITEC >>> CORE>> id="mod-heitec.2jee.core" base-set="1" build-order="2">>> lang="en">HEITEC J2EE CORE>> svn-base-dir="heitec-j2ee-core"/>>> base-set="1" build-order="3" >>> persisted="1">CACHE>> lang="en">CACHE>> svn-base-dir="cache"/>>> id="mod-sec" eap-id="2" base-set="1" build-order="4" persisted="1" >>> gui="1">Security, Permission Management to all >>> ModulesSEC>> lang="en">SECURITY>> base-set="1" build-order="5" catalog="1" persisted="1" >>> gui="1">CE>> lang="en">CENTRAL>> type="xph-caption-defines">???>> type="catalog-defines">src/de/heitec/empic/service/catalogs/model/vo/CatalogDefines.java>> id="mod-qs" eap-id="9" base-set="1" build-order="6" persisted="1" >>> gui="1">QS>> lang="en">QuerySynthesizer>> eap-id="1" >>> base-set="1" build-order="7" catalog="1" persisted="1" >>> gui="1">CMCustomer >>> ManagementKundenverwaltung>> svn-base-dir="cm">>> param="CMHistoryConstants">src/de/heitec/empic/admin/model/vo/CMHistoryConstants.java >>> >>> =========================================================== >>> >>> 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@... >>> 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 ```
 Re: [Xmltask-users] Using a property value as input source for a buffer From: Holger Rauch - 2007-10-05 14:50:49 Attachments: Message as HTML ```Hi Brian, first of all, thanks a lot for your help. However, the segment given below produces an error. On Fri, 05 Oct 2007, Brian Agnew wrote: > >> [...] > >> You could instead create an in-memory XML doc using properties thus: > >> > >> > >> > >> >> \${your.property} > >> ]]> > >> > >> > >> [...] This solution looks nice since I can do without the intermediate step of writing the property to a file. However, I got this error message: /home/hrauch/bazl/EmpicSuite-trunk/ant-feature-tests/xmltest-read.xml:271: Failed to add text to insert/paste (line 271 is the line where the starts). Unfortunately, the error message doesn't tell me *why* the failed. Can you think of any reason why? Thanks in advance for any info! Kind regards, Holger ```
 Re: [Xmltask-users] Using a property value as input source for a buffer From: Brian Agnew - 2007-10-05 15:13:09 ```Strange. I've just done: \${test} ]]> which works out of the box. Does your property evaluate to XML with a root node ? Brian On Fri, October 5, 2007 15:50, Holger Rauch wrote: > Hi Brian, > > first of all, thanks a lot for your help. However, the segment > given below produces an error. > > On Fri, 05 Oct 2007, Brian Agnew wrote: > >> >> [...] >> >> You could instead create an in-memory XML doc using properties thus: >> >> >> >> >> >> >> >> > >> \${your.property} >> >> ]]> >> >> >> >> >> >> [...] > > This solution looks nice since I can do without the intermediate step of > writing the property to a file. > > However, I got this error message: > > /home/hrauch/bazl/EmpicSuite-trunk/ant-feature-tests/xmltest-read.xml:271: > Failed to add text to insert/paste > > (line 271 is the line where the starts). > > Unfortunately, the error message doesn't tell me *why* the > failed. > Can you think of any reason why? > > Thanks in advance for any info! > > 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@... > 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 ```
 Re: [Xmltask-users] Using a property value as input source for a buffer From: Holger Rauch - 2007-10-05 16:08:34 Attachments: Message as HTML ```Hi Brian, first of all, thanks for your quick reply. What's different from your test is that my property contains a complete XML document (see below). Any idea? Thanks in advance for any info! Kind regards, Holger =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ; HEITEC CORE HEITEC J2EE CORE CACHE CACHE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > [...]=20 > which works out of the box. Does your property evaluate to XML with a root > node ? ```
 Re: [Xmltask-users] Using a property value as input source for a buffer From: Brian Agnew - 2007-10-05 16:51:08 ```Unfortunately I've been away and not attending to this list so I'm trying to clear the backlog. The test below fails (interestingly enough) if the XML to be inserted contains an XML processing instruction (as yours does). e.g. ..... ]]> A quick fix will not be forthcoming but I will try and perform an investigation in the next few days. In the meantime I think you'll have to write out the file and then read it back into XMLTask. Brian On Fri, October 5, 2007 17:08, Holger Rauch wrote: > Hi Brian, > > first of all, thanks for your quick reply. What's different from your test > is that my property contains a complete XML document (see below). Any > idea? > > Thanks in advance for any info! > > Kind regards, > > Holger > > ===================================================================== version="1.0" encoding="UTF-8"?> > xmlns:xs="http://www.w3.org/2001/XMLSchema"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">; > > > HEITEC CORE > > > > > > HEITEC J2EE CORE > > > > > > CACHE > CACHE > > > > > > ============================================================================> > [...] >> which works out of the box. Does your property evaluate to XML with a >> root >> node ? > -- Brian Agnew http://www.oopsconsultancy.com OOPS Consultancy Ltd Tel: +44 (0)7720 397526 Fax: +44 (0)20 8682 0012 ```
 Re: [Xmltask-users] Using a property value as input source for a buffer From: Brian Agnew - 2007-10-05 17:00:25 ```Ah. The error is due to the way the XML is read literally from the build.xml. Running 'ant -verbose' gives more info. So: .... results in spaces before the XML processing instruction, which is not permitted. I got the below to work by doing this: which removes any leading spaces. I think this should work in a similar fashion for you. Brian On Fri, October 5, 2007 17:51, Brian Agnew wrote: > Unfortunately I've been away and not attending to this list so I'm trying > to clear the backlog. > > The test below fails (interestingly enough) if the XML to be inserted > contains an XML processing instruction (as yours does). > > e.g. > > > > ..... > ]]> > > A quick fix will not be forthcoming but I will try and perform an > investigation in the next few days. In the meantime I think you'll have to > write out the file and then read it back into XMLTask. > > Brian > > On Fri, October 5, 2007 17:08, Holger Rauch wrote: >> Hi Brian, >> >> first of all, thanks for your quick reply. What's different from your >> test >> is that my property contains a complete XML document (see below). Any >> idea? >> >> Thanks in advance for any info! >> >> Kind regards, >> >> Holger >> >> =====================================================================> version="1.0" encoding="UTF-8"?> >> > xmlns:xs="http://www.w3.org/2001/XMLSchema"; >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">; >> >> >> HEITEC CORE >> >> >> >> >> >> HEITEC J2EE CORE >> >> >> >> >> >> CACHE >> CACHE >> >> >> >> >> >> ============================================================================> >> [...] >>> which works out of the box. Does your property evaluate to XML with a >>> root >>> node ? >> > > > -- > 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@... > 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 ```
 Re: [Xmltask-users] Using a property value as input source for a buffer From: Holger Rauch - 2007-10-08 13:03:35 Attachments: Message as HTML ```Hi Brian, thanks a lot for your help. Indeed your suggestion On Fri, 05 Oct 2007, Brian Agnew wrote: > [...]=20 > I got the below to work by doing this: >=20 > > >=20 > which removes any leading spaces. I think this should work in a similar > fashion for you. > [...] fixed my problem. A nice addition to xmltask's capabilities would be a sourceproperty attribute (there's already source and sourcebuffer) in case xmltask's input comes from another Ant task (e.g. ) that stores it's output in a property. What's your impression on that? A still better way would be some sort of an implementation of the pipe concept within Ant itself (in a way it's used in e.g. Unix shells) so that you can use the output of one Ant task/target as the input source for another Ant task/target. I asked about that on the Ant user mailing list but it doesn't seem to exist. (Unless there's some optional Ant task I'm not aw= are of that provides that functionality). Are you aware of such a task? Thanks in advance for any info! Kind regards, Holger ```