Closed karrayhamdi closed 6 years ago
Could you provide your config file and the release of gaulois-pipe you use, to be able to create a test case ?
here is it :)
<config xmlns="http://efl.fr/chaine/saxon-pipe/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<pipe mutiThreadMaxSourceSize="40000000" nbThreads="8">
<xslt href="$[xslt-file-uri]"/>
<output id="html">
<folder absolute="$[output-dir-uri]"/>
<fileName name="$[input-basename].xml"/>
</output>
</pipe>
<params>
<param name="xslt-file-uri" value=""/>
<param name="output-dir-uri" value=""/>
<param name="input-dir-uri" value=""/>
</params>
<sources>
<folder href="$[input-dir-uri]" pattern=".*\.xml" recurse="false"/>
</sources>
</config>
And the value of xslt-file-uri
you provide ?
i tried both "file:/d:/..../toto.xsl" and "d:/.../toto.xsl".
Here is a piece of code, to disply files as URI. This image shows the File I want to log as URI
The code is :
public static void main(String[] args) {
File local = new File(".");
FileSystem fs = FileSystems.getDefault();
Path d = null;
for(Path path: fs.getRootDirectories()) {
if(path.toString().toLowerCase().startsWith("d")) {
d = path;
break;
}
}
if(d==null) {
System.err.println("d: not found");
return;
}
File fD = d.toFile();
File devel = new File(fD, "devel");
File output = new File(devel, "output.log");
System.out.println("output.toString(): "+output.toString());
System.out.println("output.getAbsolutePath: "+output.getAbsolutePath());
System.out.println("output.toURI().toString(): "+output.toURI().toString());
}
Output of this code is :
output.toString(): D:\devel\output.log
output.getAbsolutePath: D:\devel\output.log
output.toURI().toString(): file:/D:/devel/output.log
I think, if you try file:/D:/.../toto.xsl
, it should work correctly.
BUT : this is not a good practise. As properties may change from input file to input file, XSL won't be compiled when gaulois-pipe starts, but when required, and won't be cached, so will be compiled each time is need. You'd better use constant XSLT URIs.
Tell me if this solve your problem.
I already tried that but still not working for me.
This is my project.
This project allow you performing tnr on html. It need some xml files, 2 xslt and a working directory.
To run it :
main class :
eu.els.sie.efl.html.tnr.Run
params :
-xmlDirPath D:\08-ELS\15-CONVBIL\00-DATA\xml -workDirPath D:\08-ELS\15-CONVBIL\00-DATA\work -originalXsltFilePath D:\08-ELS\11-BOFIP\sie-efl-sgml2html\src\main\xslt\codescV2.xslt -revisedXsltFilePath D:\08-ELS\15-CONVBIL\01-DEV\sie-efl-sgml2html\src\main\xslt\codescV2.xslt
I get this exception (note that file:/ is in the middle of the path) :
Caused by: fr.efl.chaine.xslt.InvalidSyntaxException: D:\08-ELS\15-CONVBIL\01-DEV\html-tnr\file:\D:\08-ELS\11-BOFIP\sie-efl-sgml2html\src\main\xslt\codescV2.xslt does not exists or is not a regular file
at fr.efl.chaine.xslt.config.Xslt.verify(Xslt.java:98) ~[gaulois-pipe-1.03.01.jar:?]
at fr.efl.chaine.xslt.config.Pipe.verify(Pipe.java:77) ~[gaulois-pipe-1.03.01.jar:?]
at fr.efl.chaine.xslt.config.Config.verify(Config.java:97) ~[gaulois-pipe-1.03.01.jar:?]
at com.processing.step.GauloisPipeStep.run(GauloisPipeStep.java:128) ~[processing-0.0.2.jar:?]
... 5 more
Try running GP with these parameters :
-xmlDirPath file:/D:/08-ELS/15-CONVBIL/00-DATA/xml -workDirPath file:/D:/08-ELS/15-CONVBIL/00-DATA/work -originalXsltFilePath file:/D:/08-ELS/11-BOFIP/sie-efl-sgml2html/src/main/xslt/codescV2.xslt -revisedXsltFilePath file:/D:/08-ELS/15-CONVBIL/01-DEV/sie-efl-sgml2html/src/main/xslt/codescV2.xslt
Or, better, launch me a ZIP file, with a .bat, that I could reproduce exactly your problem.
:) i take file path as paratmeter and i pass new File(filePath).toUri.toString() to gaulois-pipe
tnr-0.0.2-SNAPSHOT-linux.tar.gz
script Run with 4 param as file path. Thanks :)
And I run this on WHAT ? I can not understand why you open an issue with windows-like file pathes problems, and give a sample program call xxx-linux-xxx with a bash script in...
Problem identified.
Release 1.03.04-RC4 published. You have to wait a little bit to be synchronized on maven central. Watch http://repo1.maven.org/maven2/top/marchand/xml/gaulois-pipe/
perfect :)
Hi,
i get an error whe i call an external xslt, with absolute path or uri. href is considered as path here
and as uri here
The best way, il think, is to consider href as an uri everywhere.
thanks :)