Thank for your reply Kenney.

I did not formulate my question right.
The problem is that <core:include> cannot accept a file reference formatted as a DOS path (e.g. E:\path\file.ext), while this is the format returned by the fileScanner iterator.
So, in order to use the returned file reference I must prepend "file:///" (i.e. "file:///E:\path\file.ext" works).


My concern is that leads to platform dependence - that is why I asked for a "normalization" function (i.e. something that I can pass it a platform-specific file reference format and receive a platform-independent file reference format).

Adrian.

P.S. The core:included file is not a Jelly script - it uses a different XML namespace. Besides, if that was the problem, as the error message erroneously suggest, then it should work while referenced through the file:// protocol.

Kenney Westerhof wrote:
On Wed, 18 May 2005, Adrian Herscu wrote:

Hi there,

Below is the answer to your questions and an answer to your problem
(no, they are not the same ;))


Hi all,

I am using <ant:fileScanner> to validate all XML files in a
given directory ${src.dir}.

                <core:include uri="${xmlFilePath}" />

                <!-- this line works (?) -->
                <core:include uri="file:///${xmlFilePath}" />
BUILD FAILED
File...... E:\Documents\bmf1972\My Tests\core\maven.xml
Element... core:include
Line...... 99
Column.... 39
null:-1:-1: <null> Could not parse Jelly script

My question is about the consistency of the file references. If
some function returns file references in DOS format (e.g.
D:\path\filename.ext) then why other functions cannot accept this?


They can. file://D:\path\filename.ext should work in Windows.


Is there some function that can be used to "normalize" file
references?


Probably, but that's not relevant here :)

core:include includes the referenced file in the current jelly script,
and after the include, jelly tries to evaluate it. It works like
a XInclude, and the parse error you get is from the included file not
being a correct jelly script.

So you might want to validate your xml files differently.

Greetings,

        Kenney Westerhof


Thanks for your time,
Adrian.

P.S. Also, from the error message is clear that the file
reference format is the problem...


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to