You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Z W <mp...@gmail.com> on 2008/03/07 00:17:27 UTC

csv to html via xslt or xslt2 task ?

Hi ppl,

I have a few rows of comma delimited csv file.


1204823515990,2091,Cl,200,OK,M,text,true

1204823518623,828,Su,200,OK,M,text,true

1204823519500,66,Se,200,OK,M,text,true

1204823519604,42,Se,OK,M,text,true

and I like to transform it into html with xslt or xslt2.  Is that possible ?

Could someone provide a simple example to manipulate 2 field in a stylesheet
? I'm new to this hence

such a question.

Thanks

Re: AW: csv to html via xslt or xslt2 task ?

Posted by "Scot P. Floess" <fl...@mindspring.com>.
If you are able to use Ant contrib, you may be able to do something with 
the "for" task - and customize some type of output...

Z W wrote:
> Dan, Jan
> Thanks for the responses.
> My need right now isn't merely to change csv to html.
> I have extra processsing to do with those csv rows and output to html
> finally
> and it looks like yours is a python script, which I'm not too keen to use
> for this
> purpose.
>
> On Fri, Mar 7, 2008 at 8:59 AM, Dan Stromberg <ds...@gmail.com>
> wrote:
>
>   
>> http://stromberg.dnsalias.org/~dstromberg/to-table.html
>>
>> Jan.Materne@rzf.fin-nrw.de wrote:
>>     
>>> XSLT needs XML as input - so CSV wouldnt work.
>>> If you want to use XSLT you need the step of converting csv to xml
>>>       
>> before.
>>     
>>> Smallest way would use <script>:
>>> - write html header
>>> - iterate over the textfile line by line
>>>   -- split the line by ","
>>>   -- write the data line
>>> - write html footer
>>>
>>> Mmh ... maybe AntContrib:for could iterate over textfiles - I dont know.
>>>
>>>
>>> Jan
>>>
>>>
>>>
>>>       
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: Z W [mailto:mpc8250@gmail.com]
>>>> Gesendet: Freitag, 7. März 2008 00:17
>>>> An: Ant Users List
>>>> Betreff: csv to html via xslt or xslt2 task ?
>>>>
>>>> Hi ppl,
>>>>
>>>> I have a few rows of comma delimited csv file.
>>>>
>>>>
>>>> 1204823515990,2091,Cl,200,OK,M,text,true
>>>>
>>>> 1204823518623,828,Su,200,OK,M,text,true
>>>>
>>>> 1204823519500,66,Se,200,OK,M,text,true
>>>>
>>>> 1204823519604,42,Se,OK,M,text,true
>>>>
>>>> and I like to transform it into html with xslt or xslt2.  Is
>>>> that possible ?
>>>>
>>>> Could someone provide a simple example to manipulate 2 field
>>>> in a stylesheet
>>>> ? I'm new to this hence
>>>>
>>>> such a question.
>>>>
>>>> Thanks
>>>>
>>>>
>>>>         
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>       
>>
>>
>>     
>
>   

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros


Re: AW: csv to html via xslt or xslt2 task ?

Posted by Z W <mp...@gmail.com>.
Dan, Jan
Thanks for the responses.
My need right now isn't merely to change csv to html.
I have extra processsing to do with those csv rows and output to html
finally
and it looks like yours is a python script, which I'm not too keen to use
for this
purpose.

On Fri, Mar 7, 2008 at 8:59 AM, Dan Stromberg <ds...@gmail.com>
wrote:

>
> http://stromberg.dnsalias.org/~dstromberg/to-table.html
>
> Jan.Materne@rzf.fin-nrw.de wrote:
> > XSLT needs XML as input - so CSV wouldnt work.
> > If you want to use XSLT you need the step of converting csv to xml
> before.
> >
> > Smallest way would use <script>:
> > - write html header
> > - iterate over the textfile line by line
> >   -- split the line by ","
> >   -- write the data line
> > - write html footer
> >
> > Mmh ... maybe AntContrib:for could iterate over textfiles - I dont know.
> >
> >
> > Jan
> >
> >
> >
> >> -----Ursprüngliche Nachricht-----
> >> Von: Z W [mailto:mpc8250@gmail.com]
> >> Gesendet: Freitag, 7. März 2008 00:17
> >> An: Ant Users List
> >> Betreff: csv to html via xslt or xslt2 task ?
> >>
> >> Hi ppl,
> >>
> >> I have a few rows of comma delimited csv file.
> >>
> >>
> >> 1204823515990,2091,Cl,200,OK,M,text,true
> >>
> >> 1204823518623,828,Su,200,OK,M,text,true
> >>
> >> 1204823519500,66,Se,200,OK,M,text,true
> >>
> >> 1204823519604,42,Se,OK,M,text,true
> >>
> >> and I like to transform it into html with xslt or xslt2.  Is
> >> that possible ?
> >>
> >> Could someone provide a simple example to manipulate 2 field
> >> in a stylesheet
> >> ? I'm new to this hence
> >>
> >> such a question.
> >>
> >> Thanks
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
>
>
>
>

Re: AW: csv to html via xslt or xslt2 task ?

Posted by "Scot P. Floess" <fl...@mindspring.com>.
Additionally, I have CSV parsers at http://jplate.sourceforge.net - 
there are 2:  one that adheres to RFC4180 and another that is a little 
more lax than the RFC...  As Steve mentions, it isn't sufficient to 
break on commas if they are enclosed in quotes (same holds true of line 
breaks)...

I have examples and a utility package that can take a String, Stream, 
Reader, etc, and return a List <List <String>>



Steve Loughran wrote:
> Dan Stromberg wrote:
>>
>> http://stromberg.dnsalias.org/~dstromberg/to-table.html
>>
>> Jan.Materne@rzf.fin-nrw.de wrote:
>>> XSLT needs XML as input - so CSV wouldnt work.
>>> If you want to use XSLT you need the step of converting csv to xml 
>>> before.
>>>
>>> Smallest way would use <script>:
>>> - write html header
>>> - iterate over the textfile line by line
>>>   -- split the line by ","
>>>   -- write the data line
>>> - write html footer
>>>
>>> Mmh ... maybe AntContrib:for could iterate over textfiles - I dont 
>>> know.
>>>
>>>
>>> Jan
>>>
>
>
> I was doing some CSV work at work last week, turning spreadsheet 
> columns into email. Life is a lot easier if you can push out the CSV 
> as email, which you can get OpenOffice to do.
>
> If you dont want to go that route (or want a batch process from CSV to 
> HTML), use OpenCSV http://opencsv.sourceforge.net/ Its a nice little 
> library which does the parsing. Set it up to run through your file and 
> generate the XML that you then pump though XSL
>
> *note that splitting the line by , isnt enough, you need to deal with 
> quoted entries, commas in quotes, etc. Let someone else get the parser 
> right.
>
> FYI, the code I wrote is up here:
> http://smartfrog.svn.sourceforge.net/viewvc/smartfrog/trunk/core/components/csvfiles/ 
>
>

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros


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


Re: AW: csv to html via xslt or xslt2 task ?

Posted by Steve Loughran <st...@apache.org>.
Dan Stromberg wrote:
> 
> http://stromberg.dnsalias.org/~dstromberg/to-table.html
> 
> Jan.Materne@rzf.fin-nrw.de wrote:
>> XSLT needs XML as input - so CSV wouldnt work.
>> If you want to use XSLT you need the step of converting csv to xml 
>> before.
>>
>> Smallest way would use <script>:
>> - write html header
>> - iterate over the textfile line by line
>>   -- split the line by ","
>>   -- write the data line
>> - write html footer
>>
>> Mmh ... maybe AntContrib:for could iterate over textfiles - I dont know.
>>
>>
>> Jan
>>


I was doing some CSV work at work last week, turning spreadsheet columns 
into email. Life is a lot easier if you can push out the CSV as email, 
which you can get OpenOffice to do.

If you dont want to go that route (or want a batch process from CSV to 
HTML), use OpenCSV http://opencsv.sourceforge.net/ Its a nice little 
library which does the parsing. Set it up to run through your file and 
generate the XML that you then pump though XSL

*note that splitting the line by , isnt enough, you need to deal with 
quoted entries, commas in quotes, etc. Let someone else get the parser 
right.

FYI, the code I wrote is up here:
http://smartfrog.svn.sourceforge.net/viewvc/smartfrog/trunk/core/components/csvfiles/

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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


Re: AW: csv to html via xslt or xslt2 task ?

Posted by Dan Stromberg <ds...@gmail.com>.
http://stromberg.dnsalias.org/~dstromberg/to-table.html

Jan.Materne@rzf.fin-nrw.de wrote:
> XSLT needs XML as input - so CSV wouldnt work.
> If you want to use XSLT you need the step of converting csv to xml before.
>
> Smallest way would use <script>:
> - write html header
> - iterate over the textfile line by line
>   -- split the line by ","
>   -- write the data line
> - write html footer
>
> Mmh ... maybe AntContrib:for could iterate over textfiles - I dont know.
>
>
> Jan
>
>
>   
>> -----Ursprüngliche Nachricht-----
>> Von: Z W [mailto:mpc8250@gmail.com] 
>> Gesendet: Freitag, 7. März 2008 00:17
>> An: Ant Users List
>> Betreff: csv to html via xslt or xslt2 task ?
>>
>> Hi ppl,
>>
>> I have a few rows of comma delimited csv file.
>>
>>
>> 1204823515990,2091,Cl,200,OK,M,text,true
>>
>> 1204823518623,828,Su,200,OK,M,text,true
>>
>> 1204823519500,66,Se,200,OK,M,text,true
>>
>> 1204823519604,42,Se,OK,M,text,true
>>
>> and I like to transform it into html with xslt or xslt2.  Is 
>> that possible ?
>>
>> Could someone provide a simple example to manipulate 2 field 
>> in a stylesheet
>> ? I'm new to this hence
>>
>> such a question.
>>
>> Thanks
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>   




Re: AW: NullPointerException

Posted by Matt Benson <gu...@yahoo.com>.
Looks like
https://issues.apache.org/bugzilla/show_bug.cgi?id=41284
to me.

-Matt

--- Alexander Pavlenko <al...@db.com>
wrote:

> Here is the whole target:
> 
>     <target name="load-project-metadata" depends="
> persist-long-living-properties">
>         <fail unless="project.has.buildable.units"
> message="The current 
> project contains no buildable modules"/>
>         <dependset>
>             <srcfilelist dir="${project.dir}"
> files="
> ${project.all.unit.descriptor.files}"/>
>             <srcfileset
> file="${global.lib.dir}/libraries.xml"/>
>             <srcfileset
> file="${global.dist.dir}/libraries.xml"/>
>             <srcfileset
> file="${project.build.dir}/libraries.xml"/>
>             <srcfileset
> file="${project.build.dir}/launchers.xml"/>
>             <targetfileset
> file="${project.tmp.dir}/project-metadata.xml
> "/>
>         </dependset>
>         <x:dir-to-uri
> dir="${project.build.dir}/launchers.xml" property="
> project.launchers.descriptor.uri"/>
>         <xslt
> in="${project.build.dir}/libraries.xml" out="
> ${project.tmp.dir}/project-metadata.xml" style="
> ${global.build.dir}/generate-project-metadata.xslt">
>             <param name="project-debug-flag"
> expression="
> ${project.debug.flag.boolean}"/>
>             <param name="global-p4root-dir"
> expression="
> ${global.p4root.dir}"/>
>             <param name="project-code"
> expression="${project.code}"/>
>             <param name="project-uri"
> expression="${project.uri}"/>
>             <param name="project-tmp-dir-rel"
> expression="
> ${project.tmp.dir.rel}"/>
>             <param name="project-all-unit-locations"
> expression="
> ${project.all.unit.locations}"/>
>             <param
> name="project-launchers-descriptor-uri" expression="
> ${project.launchers.descriptor.uri}"/>
>             <param name="project-deployment-dir"
> expression="
> ${project.deployment.dir}"/>
>             <param name="project-deployment-uri"
> expression="
> ${project.deployment.uri}"/>
>             <param
> name="project-launchers-folder-name" expression="
> ${project.launchers.folder.name}"/>
>             <xmlcatalog refid="xml-catalog"/>
>         </xslt>
>         <xmlproperty
> file="${project.tmp.dir}/project-metadata.xml" 
> keeproot="no" prefix="project"/>
>     </target>
> 
> 
> Here is all the files involved in dependset ordered
> by its timestamps
> 
> 2007-10-18 10:47:02.968712000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/build/launchers.xml
> 2007-10-18 10:47:04.093958000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/.classpath
> 2007-10-18 10:47:04.094348000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/.project
> 2007-10-18 10:47:04.094456000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/build.xml
> 2007-10-18 10:47:04.205116000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/.classpath
> 2007-10-18 10:47:04.205217000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/.project
> 2007-10-18 10:47:04.205377000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/build.xml
> 2007-10-18 10:47:04.205558000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/.classpath
> 2007-10-18 10:47:04.256329000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/.project
> 2007-10-18 10:47:04.256447000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/build.xml
> 2007-10-18 10:47:04.611558000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/.classpath
> 2007-10-18 10:47:04.611779000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/.project
> 2007-10-18 10:47:04.611910000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/build.xml
> 2007-10-18 10:47:04.710560000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/.project
> 2007-10-18 10:47:04.938316000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/.classpath
> 2007-10-18 10:47:04.938709000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/.project
> 2007-10-18 10:47:04.938804000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/build.xml
> 2007-12-17 15:38:22.579139000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/.classpath
> 2007-12-17 15:38:22.639438000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/.project
> 2007-12-17 15:38:22.699555000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/build.xml
> 2008-02-22 14:14:10.102591000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/.classpath
> 2008-02-22 14:14:10.104269000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/.project
> 2008-02-22 14:14:10.116413000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/build.xml
> 2008-03-06 12:55:37.846305000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/build.xml
> 2008-03-06 12:55:38.003297000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/.classpath
> 2008-03-06 12:55:38.004725000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/.project
> 2008-03-06 16:05:12.872139000 +0300 
>
/export/apps/tpbuild/trdproc/_infrastructure/dist/libraries.xml
> 2008-03-06 16:05:40.736998000 +0300 
>
/export/apps/tpbuild/trdproc/_infrastructure/lib/libraries.xml
> 2008-03-06 16:05:40.984057000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/build/libraries.xml
> 2008-03-06 16:05:40.996537000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/.classpath
> 2008-03-06 21:14:50.313841000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/build.xml
> 2008-03-07 11:43:24.007690000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp/project-metadata.xml
> 
> As you can see, the target file (the last one) is
> the newest one but the 
> ant outputs the following:
> 
> load-project-metadata:
> fileset: Setup scanner in dir 
> /export/apps/tpbuild/trdproc/_infrastructure/lib
> with patternSet{ 
> includes: [libraries.xml] excludes: [] }
> fileset: Setup scanner in dir 
> /export/apps/tpbuild/trdproc/_infrastructure/dist
> with patternSet{ 
> includes: [libraries.xml] excludes: [] }
> fileset: Setup scanner in dir 
> /export/apps/tpbuild/trdproc/swhandler/dev/build
> with patternSet{ 
> includes: [libraries.xml] excludes: [] }
> fileset: Setup scanner in dir 
> /export/apps/tpbuild/trdproc/swhandler/dev/build
> with patternSet{ 
> includes: [launchers.xml] excludes: [] }
> fileset: Setup scanner in dir 
> /export/apps/tpbuild/trdproc/swhandler/dev/.tmp with
> patternSet{ includes: 
> [project-metadata.xml] excludes: [] }
> [dependset] 
>
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp/project-metadata.xml
> is 
> oldest target file
> 
> If I change the timestamp of the target file 
> 
> touch -t 200701010000 
>
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp/project-metadata.xml
> 
> so that it become the oldest file 
> 
> 2007-01-01 00:00:00.000000000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp/project-metadata.xml
> 2007-10-18 10:47:02.968712000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/build/launchers.xml
> 2007-10-18 10:47:04.093958000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/.classpath
> 2007-10-18 10:47:04.094348000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/.project
> 2007-10-18 10:47:04.094456000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/build.xml
> 2007-10-18 10:47:04.205116000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/.classpath
> 2007-10-18 10:47:04.205217000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/.project
> 2007-10-18 10:47:04.205377000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/build.xml
> 2007-10-18 10:47:04.205558000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/.classpath
> 2007-10-18 10:47:04.256329000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/.project
> 2007-10-18 10:47:04.256447000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/build.xml
> 2007-10-18 10:47:04.611558000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/.classpath
> 2007-10-18 10:47:04.611779000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/.project
> 2007-10-18 10:47:04.611910000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/build.xml
> 2007-10-18 10:47:04.710560000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/.project
> 2007-10-18 10:47:04.938316000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/.classpath
> 2007-10-18 10:47:04.938709000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/.project
> 2007-10-18 10:47:04.938804000 +0400 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/build.xml
> 2007-12-17 15:38:22.579139000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/.classpath
> 2007-12-17 15:38:22.639438000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/.project
> 2007-12-17 15:38:22.699555000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/build.xml
> 2008-02-22 14:14:10.102591000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/.classpath
> 2008-02-22 14:14:10.104269000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/.project
> 2008-02-22 14:14:10.116413000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/build.xml
> 2008-03-06 12:55:37.846305000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/build.xml
> 2008-03-06 12:55:38.003297000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/.classpath
> 2008-03-06 12:55:38.004725000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/.project
> 2008-03-06 16:05:12.872139000 +0300 
>
/export/apps/tpbuild/trdproc/_infrastructure/dist/libraries.xml
> 2008-03-06 16:05:40.736998000 +0300 
>
/export/apps/tpbuild/trdproc/_infrastructure/lib/libraries.xml
> 2008-03-06 16:05:40.984057000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/build/libraries.xml
> 2008-03-06 16:05:40.996537000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/.classpath
> 2008-03-06 21:14:50.313841000 +0300 
>
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/build.xml
> 
> the ant outputs the same
> 
> load-project-metadata:
> fileset: Setup scanner in dir 
> /export/apps/tpbuild/trdproc/_infrastructure/lib
> with patternSet{ 
> includes: [libraries.xml] excludes: [] }
> fileset: Setup scanner in dir 
> /export/apps/tpbuild/trdproc/_infrastructure/dist
> with patternSet{ 
> includes: [libraries.xml] excludes: [] }
> fileset: Setup scanner in dir 
> /export/apps/tpbuild/trdproc/swhandler/dev/build
> with patternSet{ 
> includes: [libraries.xml] excludes: [] }
> fileset: Setup scanner in dir 
> /export/apps/tpbuild/trdproc/swhandler/dev/build
> with patternSet{ 
> includes: [launchers.xml] excludes: [] }
> fileset: Setup scanner in dir 
> /export/apps/tpbuild/trdproc/swhandler/dev/.tmp with
> patternSet{ includes: 
> [project-metadata.xml] excludes: [] }
> [dependset] 
>
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp/project-metadata.xml
> is 
> oldest target file
> 
> But if I remove the target file then the exception
> disappears.
> 
> This problem happens on Solaris but doesn't happen
> on windows.
> 
> 
> 
> 
> 
> <Ja...@rzf.fin-nrw.de> 
> 07.03.2008 10:38
> Please respond to
> "Ant Users List" <us...@ant.apache.org>
> 
> 
> To
> <us...@ant.apache.org>
> cc
> 
> Subject
> AW: NullPointerException
> 
> 
> 
> 
> 
> 
> Can you post the snippet around the <dependendset>?
> 
> Jan 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Alexander Pavlenko
> [mailto:alexander.pavlenko@db.com] 
> > Gesendet: Freitag, 7. März 2008 08:25
> > An: Ant Users List
> > Betreff: NullPointerException
> > 
> > Please advise, why can this happen?
> > 
> > java.lang.NullPointerException
> >         at 
> >
>
org.apache.tools.ant.types.resources.Sort$SortedBag$MutableInt
> .access$100(Sort.java:44)
> >         at 
> >
>
org.apache.tools.ant.types.resources.Sort$SortedBag$MyIterator
> .next(Sort.java:60)
> >         at 
> >
>
org.apache.tools.ant.types.resources.FailFast.next(FailFast.java:115)
> >         at 
> >
>
org.apache.tools.ant.taskdefs.DependSet.uptodate(DependSet.java:233)
> >         at 
> >
>
org.apache.tools.ant.taskdefs.DependSet.execute(DependSet.java:202)
> >         at 
> >
>
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> >         at
> sun.reflect.GeneratedMethodAccessor2.invoke(Unknown
> Source)
> >         at 
> >
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > odAccessorImpl.java:25)
> >         at
> java.lang.reflect.Method.invoke(Method.java:585)
> >         at 
> >
>
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUt
> > ils.java:105)
> >         at
> org.apache.tools.ant.Task.perform(Task.java:348)
> >         at
> org.apache.tools.ant.Target.execute(Target.java:357)
> >         at
>
org.apache.tools.ant.Target.performTasks(Target.java:385)
> >         at 
> >
>
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
> >         at 
> >
>
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets
> > (SingleCheckExecutor.java:38)
> >         at 
> >
>
org.apache.tools.ant.Project.executeTargets(Project.java:1181)
> >         at
>
org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
> >         at 
> >
>
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
> >         at 
> >
>
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> >         at
> sun.reflect.GeneratedMethodAccessor2.invoke(Unknown
> Source)
> >         at 
> >
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > odAccessorImpl.java:25)
> >         at
> java.lang.reflect.Method.invoke(Method.java:585)
> >         at 
> >
>
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUt
> > ils.java:105)
> >         at
> org.apache.tools.ant.Task.perform(Task.java:348)
> >         at
> org.apache.tools.ant.Target.execute(Target.java:357)
> >         at
>
org.apache.tools.ant.Target.performTasks(Target.java:385)
> >         at 
> >
>
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
> >         at 
> >
>
org.apache.tools.ant.Project.executeTarget(Project.java:1298)
> >         at 
> >
>
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(Def
> > aultExecutor.java:41)
> >         at 
> >
>
org.apache.tools.ant.Project.executeTargets(Project.java:1181)
> >         at
> org.apache.tools.ant.Main.runBuild(Main.java:698)
> >         at
> org.apache.tools.ant.Main.startAnt(Main.java:199)
> >         at
>
org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
> >         at 
> >
>
org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
> > 
> > ---
> > 
> > This e-mail may contain confidential and/or
> privileged 
> > information. If you are not the intended recipient
> (or have 
> > received this e-mail in error) please notify the
> sender 
> > immediately and delete this e-mail. Any
> unauthorized copying, 
> > disclosure or distribution of the material in this
> e-mail is 
> > strictly forbidden.
> > 
> > Please refer to 
> > http://www.db.com/en/content/eu_disclosures.htm
> for 
> > additional EU corporate and regulatory
> disclosures.
> > 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 
> 
> 
> ---
> 
> This e-mail may contain confidential and/or
> privileged information. If you are not the intended
> recipient (or have received this e-mail in error)
> please notify the sender immediately and delete this
> e-mail. Any unauthorized copying, disclosure or
> distribution of the material in this e-mail is
> strictly forbidden.
> 
> Please refer to
> http://www.db.com/en/content/eu_disclosures.htm for
> additional EU corporate and regulatory disclosures.



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


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


Re: AW: NullPointerException

Posted by Alexander Pavlenko <al...@db.com>.
Here is the whole target:

    <target name="load-project-metadata" depends="
persist-long-living-properties">
        <fail unless="project.has.buildable.units" message="The current 
project contains no buildable modules"/>
        <dependset>
            <srcfilelist dir="${project.dir}" files="
${project.all.unit.descriptor.files}"/>
            <srcfileset file="${global.lib.dir}/libraries.xml"/>
            <srcfileset file="${global.dist.dir}/libraries.xml"/>
            <srcfileset file="${project.build.dir}/libraries.xml"/>
            <srcfileset file="${project.build.dir}/launchers.xml"/>
            <targetfileset file="${project.tmp.dir}/project-metadata.xml
"/>
        </dependset>
        <x:dir-to-uri dir="${project.build.dir}/launchers.xml" property="
project.launchers.descriptor.uri"/>
        <xslt in="${project.build.dir}/libraries.xml" out="
${project.tmp.dir}/project-metadata.xml" style="
${global.build.dir}/generate-project-metadata.xslt">
            <param name="project-debug-flag" expression="
${project.debug.flag.boolean}"/>
            <param name="global-p4root-dir" expression="
${global.p4root.dir}"/>
            <param name="project-code" expression="${project.code}"/>
            <param name="project-uri" expression="${project.uri}"/>
            <param name="project-tmp-dir-rel" expression="
${project.tmp.dir.rel}"/>
            <param name="project-all-unit-locations" expression="
${project.all.unit.locations}"/>
            <param name="project-launchers-descriptor-uri" expression="
${project.launchers.descriptor.uri}"/>
            <param name="project-deployment-dir" expression="
${project.deployment.dir}"/>
            <param name="project-deployment-uri" expression="
${project.deployment.uri}"/>
            <param name="project-launchers-folder-name" expression="
${project.launchers.folder.name}"/>
            <xmlcatalog refid="xml-catalog"/>
        </xslt>
        <xmlproperty file="${project.tmp.dir}/project-metadata.xml" 
keeproot="no" prefix="project"/>
    </target>


Here is all the files involved in dependset ordered by its timestamps

2007-10-18 10:47:02.968712000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/build/launchers.xml
2007-10-18 10:47:04.093958000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/.classpath
2007-10-18 10:47:04.094348000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/.project
2007-10-18 10:47:04.094456000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/build.xml
2007-10-18 10:47:04.205116000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/.classpath
2007-10-18 10:47:04.205217000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/.project
2007-10-18 10:47:04.205377000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/build.xml
2007-10-18 10:47:04.205558000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/.classpath
2007-10-18 10:47:04.256329000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/.project
2007-10-18 10:47:04.256447000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/build.xml
2007-10-18 10:47:04.611558000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/.classpath
2007-10-18 10:47:04.611779000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/.project
2007-10-18 10:47:04.611910000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/build.xml
2007-10-18 10:47:04.710560000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/.project
2007-10-18 10:47:04.938316000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/.classpath
2007-10-18 10:47:04.938709000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/.project
2007-10-18 10:47:04.938804000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/build.xml
2007-12-17 15:38:22.579139000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/.classpath
2007-12-17 15:38:22.639438000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/.project
2007-12-17 15:38:22.699555000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/build.xml
2008-02-22 14:14:10.102591000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/.classpath
2008-02-22 14:14:10.104269000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/.project
2008-02-22 14:14:10.116413000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/build.xml
2008-03-06 12:55:37.846305000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/build.xml
2008-03-06 12:55:38.003297000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/.classpath
2008-03-06 12:55:38.004725000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/.project
2008-03-06 16:05:12.872139000 +0300 
/export/apps/tpbuild/trdproc/_infrastructure/dist/libraries.xml
2008-03-06 16:05:40.736998000 +0300 
/export/apps/tpbuild/trdproc/_infrastructure/lib/libraries.xml
2008-03-06 16:05:40.984057000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/build/libraries.xml
2008-03-06 16:05:40.996537000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/.classpath
2008-03-06 21:14:50.313841000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/build.xml
2008-03-07 11:43:24.007690000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp/project-metadata.xml

As you can see, the target file (the last one) is the newest one but the 
ant outputs the following:

load-project-metadata:
fileset: Setup scanner in dir 
/export/apps/tpbuild/trdproc/_infrastructure/lib with patternSet{ 
includes: [libraries.xml] excludes: [] }
fileset: Setup scanner in dir 
/export/apps/tpbuild/trdproc/_infrastructure/dist with patternSet{ 
includes: [libraries.xml] excludes: [] }
fileset: Setup scanner in dir 
/export/apps/tpbuild/trdproc/swhandler/dev/build with patternSet{ 
includes: [libraries.xml] excludes: [] }
fileset: Setup scanner in dir 
/export/apps/tpbuild/trdproc/swhandler/dev/build with patternSet{ 
includes: [launchers.xml] excludes: [] }
fileset: Setup scanner in dir 
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp with patternSet{ includes: 
[project-metadata.xml] excludes: [] }
[dependset] 
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp/project-metadata.xml is 
oldest target file

If I change the timestamp of the target file 

touch -t 200701010000 
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp/project-metadata.xml

so that it become the oldest file 

2007-01-01 00:00:00.000000000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp/project-metadata.xml
2007-10-18 10:47:02.968712000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/build/launchers.xml
2007-10-18 10:47:04.093958000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/.classpath
2007-10-18 10:47:04.094348000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/.project
2007-10-18 10:47:04.094456000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessUpdateHandler/build.xml
2007-10-18 10:47:04.205116000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/.classpath
2007-10-18 10:47:04.205217000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/.project
2007-10-18 10:47:04.205377000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSink/build.xml
2007-10-18 10:47:04.205558000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/.classpath
2007-10-18 10:47:04.256329000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/.project
2007-10-18 10:47:04.256447000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandler/build.xml
2007-10-18 10:47:04.611558000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/.classpath
2007-10-18 10:47:04.611779000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/.project
2007-10-18 10:47:04.611910000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Config/build.xml
2007-10-18 10:47:04.710560000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/.project
2007-10-18 10:47:04.938316000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/.classpath
2007-10-18 10:47:04.938709000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/.project
2007-10-18 10:47:04.938804000 +0400 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.Utils/build.xml
2007-12-17 15:38:22.579139000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/.classpath
2007-12-17 15:38:22.639438000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/.project
2007-12-17 15:38:22.699555000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.NovationEmailer/build.xml
2008-02-22 14:14:10.102591000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/.classpath
2008-02-22 14:14:10.104269000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/.project
2008-02-22 14:14:10.116413000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWBusinessHandler/build.xml
2008-03-06 12:55:37.846305000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/build.xml
2008-03-06 12:55:38.003297000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/.classpath
2008-03-06 12:55:38.004725000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.app.SWDealSinkHandlerSwitcher/.project
2008-03-06 16:05:12.872139000 +0300 
/export/apps/tpbuild/trdproc/_infrastructure/dist/libraries.xml
2008-03-06 16:05:40.736998000 +0300 
/export/apps/tpbuild/trdproc/_infrastructure/lib/libraries.xml
2008-03-06 16:05:40.984057000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/build/libraries.xml
2008-03-06 16:05:40.996537000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/.classpath
2008-03-06 21:14:50.313841000 +0300 
/export/apps/tpbuild/trdproc/swhandler/dev/modules/swhandler.comp.SWDealSink/build.xml

the ant outputs the same

load-project-metadata:
fileset: Setup scanner in dir 
/export/apps/tpbuild/trdproc/_infrastructure/lib with patternSet{ 
includes: [libraries.xml] excludes: [] }
fileset: Setup scanner in dir 
/export/apps/tpbuild/trdproc/_infrastructure/dist with patternSet{ 
includes: [libraries.xml] excludes: [] }
fileset: Setup scanner in dir 
/export/apps/tpbuild/trdproc/swhandler/dev/build with patternSet{ 
includes: [libraries.xml] excludes: [] }
fileset: Setup scanner in dir 
/export/apps/tpbuild/trdproc/swhandler/dev/build with patternSet{ 
includes: [launchers.xml] excludes: [] }
fileset: Setup scanner in dir 
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp with patternSet{ includes: 
[project-metadata.xml] excludes: [] }
[dependset] 
/export/apps/tpbuild/trdproc/swhandler/dev/.tmp/project-metadata.xml is 
oldest target file

But if I remove the target file then the exception disappears.

This problem happens on Solaris but doesn't happen on windows.





<Ja...@rzf.fin-nrw.de> 
07.03.2008 10:38
Please respond to
"Ant Users List" <us...@ant.apache.org>


To
<us...@ant.apache.org>
cc

Subject
AW: NullPointerException






Can you post the snippet around the <dependendset>?

Jan 

> -----Ursprüngliche Nachricht-----
> Von: Alexander Pavlenko [mailto:alexander.pavlenko@db.com] 
> Gesendet: Freitag, 7. März 2008 08:25
> An: Ant Users List
> Betreff: NullPointerException
> 
> Please advise, why can this happen?
> 
> java.lang.NullPointerException
>         at 
> org.apache.tools.ant.types.resources.Sort$SortedBag$MutableInt
.access$100(Sort.java:44)
>         at 
> org.apache.tools.ant.types.resources.Sort$SortedBag$MyIterator
.next(Sort.java:60)
>         at 
> org.apache.tools.ant.types.resources.FailFast.next(FailFast.java:115)
>         at 
> org.apache.tools.ant.taskdefs.DependSet.uptodate(DependSet.java:233)
>         at 
> org.apache.tools.ant.taskdefs.DependSet.execute(DependSet.java:202)
>         at 
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at 
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUt
> ils.java:105)
>         at org.apache.tools.ant.Task.perform(Task.java:348)
>         at org.apache.tools.ant.Target.execute(Target.java:357)
>         at org.apache.tools.ant.Target.performTasks(Target.java:385)
>         at 
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
>         at 
> org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets
> (SingleCheckExecutor.java:38)
>         at 
> org.apache.tools.ant.Project.executeTargets(Project.java:1181)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
>         at 
> org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
>         at 
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at 
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUt
> ils.java:105)
>         at org.apache.tools.ant.Task.perform(Task.java:348)
>         at org.apache.tools.ant.Target.execute(Target.java:357)
>         at org.apache.tools.ant.Target.performTasks(Target.java:385)
>         at 
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
>         at 
> org.apache.tools.ant.Project.executeTarget(Project.java:1298)
>         at 
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(Def
> aultExecutor.java:41)
>         at 
> org.apache.tools.ant.Project.executeTargets(Project.java:1181)
>         at org.apache.tools.ant.Main.runBuild(Main.java:698)
>         at org.apache.tools.ant.Main.startAnt(Main.java:199)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
>         at 
> org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
> 
> ---
> 
> This e-mail may contain confidential and/or privileged 
> information. If you are not the intended recipient (or have 
> received this e-mail in error) please notify the sender 
> immediately and delete this e-mail. Any unauthorized copying, 
> disclosure or distribution of the material in this e-mail is 
> strictly forbidden.
> 
> Please refer to 
> http://www.db.com/en/content/eu_disclosures.htm for 
> additional EU corporate and regulatory disclosures.
> 

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




---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.

AW: NullPointerException

Posted by Ja...@rzf.fin-nrw.de.
Can you post the snippet around the <dependendset>?

Jan 

> -----Ursprüngliche Nachricht-----
> Von: Alexander Pavlenko [mailto:alexander.pavlenko@db.com] 
> Gesendet: Freitag, 7. März 2008 08:25
> An: Ant Users List
> Betreff: NullPointerException
> 
> Please advise, why can this happen?
> 
> java.lang.NullPointerException
>         at 
> org.apache.tools.ant.types.resources.Sort$SortedBag$MutableInt
.access$100(Sort.java:44)
>         at 
> org.apache.tools.ant.types.resources.Sort$SortedBag$MyIterator
.next(Sort.java:60)
>         at 
> org.apache.tools.ant.types.resources.FailFast.next(FailFast.java:115)
>         at 
> org.apache.tools.ant.taskdefs.DependSet.uptodate(DependSet.java:233)
>         at 
> org.apache.tools.ant.taskdefs.DependSet.execute(DependSet.java:202)
>         at 
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at 
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUt
> ils.java:105)
>         at org.apache.tools.ant.Task.perform(Task.java:348)
>         at org.apache.tools.ant.Target.execute(Target.java:357)
>         at org.apache.tools.ant.Target.performTasks(Target.java:385)
>         at 
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
>         at 
> org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets
> (SingleCheckExecutor.java:38)
>         at 
> org.apache.tools.ant.Project.executeTargets(Project.java:1181)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
>         at 
> org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
>         at 
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at 
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUt
> ils.java:105)
>         at org.apache.tools.ant.Task.perform(Task.java:348)
>         at org.apache.tools.ant.Target.execute(Target.java:357)
>         at org.apache.tools.ant.Target.performTasks(Target.java:385)
>         at 
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
>         at 
> org.apache.tools.ant.Project.executeTarget(Project.java:1298)
>         at 
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(Def
> aultExecutor.java:41)
>         at 
> org.apache.tools.ant.Project.executeTargets(Project.java:1181)
>         at org.apache.tools.ant.Main.runBuild(Main.java:698)
>         at org.apache.tools.ant.Main.startAnt(Main.java:199)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
>         at 
> org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
> 
> ---
> 
> This e-mail may contain confidential and/or privileged 
> information. If you are not the intended recipient (or have 
> received this e-mail in error) please notify the sender 
> immediately and delete this e-mail. Any unauthorized copying, 
> disclosure or distribution of the material in this e-mail is 
> strictly forbidden.
> 
> Please refer to 
> http://www.db.com/en/content/eu_disclosures.htm for 
> additional EU corporate and regulatory disclosures.
> 

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


NullPointerException

Posted by Alexander Pavlenko <al...@db.com>.
Please advise, why can this happen?

java.lang.NullPointerException
        at 
org.apache.tools.ant.types.resources.Sort$SortedBag$MutableInt.access$100(Sort.java:44)
        at 
org.apache.tools.ant.types.resources.Sort$SortedBag$MyIterator.next(Sort.java:60)
        at 
org.apache.tools.ant.types.resources.FailFast.next(FailFast.java:115)
        at 
org.apache.tools.ant.taskdefs.DependSet.uptodate(DependSet.java:233)
        at 
org.apache.tools.ant.taskdefs.DependSet.execute(DependSet.java:202)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at 
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
        at 
org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.

AW: csv to html via xslt or xslt2 task ?

Posted by Ja...@rzf.fin-nrw.de.
XSLT needs XML as input - so CSV wouldnt work.
If you want to use XSLT you need the step of converting csv to xml before.

Smallest way would use <script>:
- write html header
- iterate over the textfile line by line
  -- split the line by ","
  -- write the data line
- write html footer

Mmh ... maybe AntContrib:for could iterate over textfiles - I dont know.


Jan


> -----Ursprüngliche Nachricht-----
> Von: Z W [mailto:mpc8250@gmail.com] 
> Gesendet: Freitag, 7. März 2008 00:17
> An: Ant Users List
> Betreff: csv to html via xslt or xslt2 task ?
> 
> Hi ppl,
> 
> I have a few rows of comma delimited csv file.
> 
> 
> 1204823515990,2091,Cl,200,OK,M,text,true
> 
> 1204823518623,828,Su,200,OK,M,text,true
> 
> 1204823519500,66,Se,200,OK,M,text,true
> 
> 1204823519604,42,Se,OK,M,text,true
> 
> and I like to transform it into html with xslt or xslt2.  Is 
> that possible ?
> 
> Could someone provide a simple example to manipulate 2 field 
> in a stylesheet
> ? I'm new to this hence
> 
> such a question.
> 
> Thanks
> 

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


RE: csv to html via xslt or xslt2 task ?

Posted by Sean Tiley <st...@meraksystems.com>.
Hi there,
I am new to XSLT but saw your post and decided to attempt a solution,
mainly as an exercise for myself.

The responses you have received have better solutions than this one, but
I offer a novice's solution, which is neither elegant or flexible


(sorry for the formatting)

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
    <xsl:output indent="yes"/>
    <!-- file location-->
    <xsl:variable name="in" 
 
select="unparsed-text('file:///c:/sean/xsl/commadelimited/comma_delimite
d.txt')"/>
    <xsl:template name="initial" match="/">
        <xsl:element name="values">
            <!-- Iterate through the lines in the file -->
            <xsl:for-each select="tokenize($in,'\r\n')">
                <xsl:variable name="line" select="."/>
                <!-- 
                    Analyze the entire line and break into captured
groups 
                    (by using ( ) around the individual pieces  
                -->
                <xsl:analyze-string select="$line"
 
regex="([0-9]+),\s*([0-9]+),\s*([A-Z]+),\s*([0-9]+),\s*([A-Z]+),\s*([A-Z
])+,s*([A-Z]+),\s*([A-Z]+)">
                    <xsl:matching-substring>
                        <xsl:element name="line">
                            <!--  
                             This just puts out the line, was included
for testing purposed
                            <xsl:element name="RawData">
                              <xsl:value-of select="regex-group(0)"/>
                            </xsl:element>
                            -->
                            <xsl:element name="Column1">
                                <xsl:value-of select="regex-group(1)"/>
                            </xsl:element>
                            <xsl:element name="Column2">
                                <xsl:value-of select="regex-group(2)"/>
                            </xsl:element>
                            <xsl:element name="Column3">
                                <xsl:value-of select="regex-group(3)"/>
                            </xsl:element>
                            <xsl:element name="Column4">
                                <xsl:value-of select="regex-group(4)"/>
                            </xsl:element>
                            <xsl:element name="Column5">
                                <xsl:value-of select="regex-group(5)"/>
                            </xsl:element>
                            <xsl:element name="Column6">
                                <xsl:value-of select="regex-group(6)"/>
                            </xsl:element>
                            <xsl:element name="Column7">
                                <xsl:value-of select="regex-group(7)"/>
                            </xsl:element>
                            <xsl:element name="Column8">
                                <xsl:value-of select="regex-group(8)"/>
                            </xsl:element>
                        </xsl:element>
                    </xsl:matching-substring>
                    <xsl:non-matching-substring>
                        <xsl:element name="UnmatchedInputLines">
                            <xsl:value-of select="."/>
                        </xsl:element>    
                    </xsl:non-matching-substring>
                </xsl:analyze-string>
            </xsl:for-each>
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>

 
-----Original Message-----
From: Z W [mailto:mpc8250@gmail.com] 
Sent: Thursday, March 06, 2008 6:17 PM
To: Ant Users List
Subject: csv to html via xslt or xslt2 task ?

Hi ppl,

I have a few rows of comma delimited csv file.


1204823515990,2091,Cl,200,OK,M,text,true

1204823518623,828,Su,200,OK,M,text,true

1204823519500,66,Se,200,OK,M,text,true

1204823519604,42,Se,OK,M,text,true

and I like to transform it into html with xslt or xslt2.  Is that
possible ?

Could someone provide a simple example to manipulate 2 field in a
stylesheet
? I'm new to this hence

such a question.

Thanks

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


RE: csv to html via xslt or xslt2 task ?

Posted by Chun Ji <CJ...@pro-unlimited.com>.
I am using Ant 1.7, and I don't think we have such thing yet. But since XSLT 2.0 has lots of new APIs that can make the xslt script much more powerful, so my feeling is it is just a matter of time to have it be part of ANT family. 

During the meaning time, what you can do is to download the XSLT2.0 package yourself and use it as a regular java application. For example, I am using  "saxon" for the XSLT2.0, and the command line would be: 

"java -cp ~/XML/saxonsa8-9j/saxon8sa.jar net.sf.saxon.Transform <xml_file> <xslt_file>" 


-c




-----Original Message-----
From: Steve Loughran [mailto:stevel@apache.org]
Sent: Tuesday, March 11, 2008 3:37 AM
To: Ant Users List
Subject: Re: csv to html via xslt or xslt2 task ?


Chun Ji wrote:
> How about "Fixed to XML (XSLT 2.0 only) " 
> 
> The difference from yours is: delimiter is ",", instead of space. 
> 
> 


Aaah, XSLT2. Does Xalan (and the ant tasks) support that?

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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


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


Re: csv to html via xslt or xslt2 task ?

Posted by Steve Loughran <st...@apache.org>.
Chun Ji wrote:
> How about "Fixed to XML (XSLT 2.0 only) " 
> 
> The difference from yours is: delimiter is ",", instead of space. 
> 
> 


Aaah, XSLT2. Does Xalan (and the ant tasks) support that?

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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


RE: csv to html via xslt or xslt2 task ?

Posted by Chun Ji <CJ...@pro-unlimited.com>.
How about "Fixed to XML (XSLT 2.0 only) " 

The difference from yours is: delimiter is ",", instead of space. 


-cji 

-----Original Message-----
From: Steve Loughran [mailto:stevel@apache.org]
Sent: Monday, March 10, 2008 10:14 AM
To: Ant Users List
Subject: Re: csv to html via xslt or xslt2 task ?


Chun Ji wrote:
> Hi there, 
> The answer is "YES". 
> If you still have this problem, take a look at here: http://www.xmlplease.com/xsltcases. 
> 
> 
> 
> -cji 

-they seem to go the other way, from XML to CSV. Which is useful, but 
not in this particular case

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


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


Re: csv to html via xslt or xslt2 task ?

Posted by Steve Loughran <st...@apache.org>.
Chun Ji wrote:
> Hi there, 
> The answer is "YES". 
> If you still have this problem, take a look at here: http://www.xmlplease.com/xsltcases. 
> 
> 
> 
> -cji 

-they seem to go the other way, from XML to CSV. Which is useful, but 
not in this particular case

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


RE: csv to html via xslt or xslt2 task ?

Posted by Chun Ji <CJ...@pro-unlimited.com>.
Hi there, 
The answer is "YES". 
If you still have this problem, take a look at here: http://www.xmlplease.com/xsltcases. 



-cji 



-----Original Message-----
From: Z W [mailto:mpc8250@gmail.com]
Sent: Thursday, March 06, 2008 3:17 PM
To: Ant Users List
Subject: csv to html via xslt or xslt2 task ?


Hi ppl,

I have a few rows of comma delimited csv file.


1204823515990,2091,Cl,200,OK,M,text,true

1204823518623,828,Su,200,OK,M,text,true

1204823519500,66,Se,200,OK,M,text,true

1204823519604,42,Se,OK,M,text,true

and I like to transform it into html with xslt or xslt2.  Is that possible ?

Could someone provide a simple example to manipulate 2 field in a stylesheet
? I'm new to this hence

such a question.

Thanks

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