You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Haldi, Silvio" <sh...@zuehlke.com> on 2005/09/05 11:13:41 UTC
RE: "x:parse" with absolute filename does not work OR "How to load/parse an xml file using absolute filename (based on Windows)"?
Hi all
I already posted the message regarding parsing an xml file using x:parse
tag (see below).
Up to now I did not receive any message that helps solving the problem.
I can't believe that nobody already ran into the same problem.
How can I use an file URL based on the basedir variable in x:parse??
File://${basedir)/foo/baar does NOT work on my WINDWOS machine (error
message see below)!
I cant use relative Pathes, especially in a multiproject environment
(using project.xml inheritance).
Can anybody help me? Is there any workaround (beside the x:parse tag),
for example using the ANT task loadFile (which runs with absolute file
names (also with non-URL syntax))?
Many Thanks
Silvio
-----Original Message-----
From: Haldi, Silvio [mailto:shd@zuehlke.com]
Sent: Donnerstag, 1. September 2005 18:33
To: Maven Users List
Subject: RE: "x:parse" with absolute filename does not work
If I do this I receive the following message:
BUILD FAILED
File...... c:\myProject\component\maven.xml
Element... x:parse
Line...... 62
Column.... 110
c Nested exception: c
Please note that I'm using windows.
The statement in maven.xml is now:
<x:parse var="myFile" xml="file://${basedir}/../mydir/myFile.xml"/>
and the path resolved looks similar too:
file://c:\myProject\component/../mydir/myFile.xml
Cheers
Silvio
-----Original Message-----
From: Kenney Westerhof [mailto:forge@neonics.com]
Sent: Donnerstag, 1. September 2005 16:00
To: Maven Users List
Subject: Re: "x:parse" with absolute filename does not work
On Thu, 1 Sep 2005, Haldi, Silvio wrote:
x:parse expects an URL, so prefix the filename with 'file://'.
> Hi
> I wan't to parse an XML document on my filesystem using the parse tag
> from the XML Jelly-library.
> If I specify the source XML file by an absolute Path it does not work.
> It seems that the parse tag is expecting a relative (to ${basedir})
> path.
>
> I want to to something like this:
>
> <x:parse var="myFile" xml="${basedir}/../mydir/myFile.xml"/>
>
> How can I do this?
>
> Thanks
> Silvio
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: "x:parse" with absolute filename does not work OR "How to load/parse an xml file using absolute filename (based on Windows)"?
Posted by Dion Gillard <di...@gmail.com>.
Create a java.io.File using ${basedir}/Foo/baar and then get the URL from it.
On 9/5/05, Haldi, Silvio <sh...@zuehlke.com> wrote:
> Hi all
> I already posted the message regarding parsing an xml file using x:parse
> tag (see below).
> Up to now I did not receive any message that helps solving the problem.
> I can't believe that nobody already ran into the same problem.
>
> How can I use an file URL based on the basedir variable in x:parse??
> File://${basedir)/foo/baar does NOT work on my WINDWOS machine (error
> message see below)!
> I cant use relative Pathes, especially in a multiproject environment
> (using project.xml inheritance).
>
> Can anybody help me? Is there any workaround (beside the x:parse tag),
> for example using the ANT task loadFile (which runs with absolute file
> names (also with non-URL syntax))?
>
> Many Thanks
> Silvio
>
> -----Original Message-----
> From: Haldi, Silvio [mailto:shd@zuehlke.com]
> Sent: Donnerstag, 1. September 2005 18:33
> To: Maven Users List
> Subject: RE: "x:parse" with absolute filename does not work
>
> If I do this I receive the following message:
>
> BUILD FAILED
> File...... c:\myProject\component\maven.xml
> Element... x:parse
> Line...... 62
> Column.... 110
> c Nested exception: c
>
> Please note that I'm using windows.
> The statement in maven.xml is now:
>
> <x:parse var="myFile" xml="file://${basedir}/../mydir/myFile.xml"/>
>
> and the path resolved looks similar too:
> file://c:\myProject\component/../mydir/myFile.xml
>
> Cheers
> Silvio
>
>
> -----Original Message-----
> From: Kenney Westerhof [mailto:forge@neonics.com]
> Sent: Donnerstag, 1. September 2005 16:00
> To: Maven Users List
> Subject: Re: "x:parse" with absolute filename does not work
>
> On Thu, 1 Sep 2005, Haldi, Silvio wrote:
>
> x:parse expects an URL, so prefix the filename with 'file://'.
>
> > Hi
> > I wan't to parse an XML document on my filesystem using the parse tag
> > from the XML Jelly-library.
> > If I specify the source XML file by an absolute Path it does not work.
> > It seems that the parse tag is expecting a relative (to ${basedir})
> > path.
> >
> > I want to to something like this:
> >
> > <x:parse var="myFile" xml="${basedir}/../mydir/myFile.xml"/>
> >
> > How can I do this?
> >
> > Thanks
> > Silvio
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> --
> Kenney Westerhof
> http://www.neonics.com
> GPG public key: http://www.gods.nl/~forge/kenneyw.key
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
http://www.multitask.com.au/people/dion/
"You are going to let the fear of poverty govern your life and your
reward will be that you will eat, but you will not live." - George
Bernard Shaw
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org