[oXygen-user] Problem reloading jars that contains XSL

Christophe Marchand cmarchand at oxiane.com
Mon Nov 5 10:42:37 CST 2018


Ok, thanks a lot, it makes sense.

But it doesn't help me anymore ! ;-)

Could your zip:file protocol handler be distributed under an open-source 
license ?

Well, as a workaround, I could generate two catalogs, one dedicated to 
Oxygen, that uses zip:file, and the current one, and declare 
${pdu}/catalog-oxygen.xml instead of ${pdu}/catalog.xml

Best regards, Adrian,
Christophe


Le 05/11/2018 à 14:18, Oxygen XML Editor Support (Adrian Buza) a écrit :
> Hi,
>
> The problem is you're using the "jar:file" protocol with a .jar file. 
> The Java loading mechanism of jar files is meant for static Java 
> resources (especially meant for Java class files) which are only 
> loaded once when they are needed. So, any changes you do to the jar in 
> the file system after the jar has already been loaded by the JVM will 
> not be available until the JVM (Oxygen) is restarted. This is normal 
> Java behavior and cannot be avoided. Oxygen cannot change this 
> behavior as long as the jar gets loaded within its own JVM. Saxon 
> transformations from Oxygen are run within Oxygen's JVM.
> This works fine in the command line because the JVM loads and exits 
> every time you run Saxon.
>
> Oxygen provides an alternative means to do what you want via the 
> "zip:file" protocol, but, obviously, this only works within Oxygen. 
> Try using:
> <xsl:import 
> href="zip:file:/Users/cmarchand/devel/foe.jar!/path/to/file.xsl" />
>
> Regards,
> Adrian
> Adrian Buza
> oXygen XML Editor and Author Support
> On 05.11.2018 11:44, Christophe Marchand wrote:
>>
>> Hello,
>>
>>
>> I have an xsl - let's name it MAIN.XSL - that import another, located 
>> in a jar file :
>>
>> <xsl:import 
>> href="jar:file:/Users/cmarchand/devel/foe.jar!/path/to/file.xsl" />
>>
>> This works perfectly, in Oxygen, with Saxon, everywhere.
>>
>> Now, if I change my <foe>/src/main/xsl/path/to/file.xsl file (inside 
>> or outside Oxygen), and rebuild the jar, when I come back to my 
>> MAIN.XSL, Oxygen displays an Error :
>>
>> I/O error reported by XML parser processing 
>> jar:file:/Users/cmarchand/devel/foe.jar!/path/to/file.xsl: JAR entry 
>> path/to/file.xsl not found in /Users/cmarchand/devel/foe.jar
>>
>> Of course, jar exists, is well formed, can be loaded by JVM, and 
>> file.xsl also exists, is also well formed, and is also correctly run 
>> by Saxon outside Oxygen.
>>
>> If I restart Oxygen, without changing foe.jar, everything works 
>> correctly. Problem exists from Oxygen 15 to 20.1
>>
>> I think Matthieu Ricaud had previously reported this problem, but 
>> maybe verbally, at XMLPrague ...
>>
>> Thanks in advance,
>> Christophe
>>
>>
>>
>> _______________________________________________
>> oXygen-user mailing list
>> oXygen-user at oxygenxml.com
>> https://www.oxygenxml.com/mailman/listinfo/oxygen-user
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20181105/c8793eaa/attachment.html>


More information about the oXygen-user mailing list