rug-compling / alpinocorpus

Library for handling Alpino corpora
GNU Lesser General Public License v2.1
8 stars 1 forks source link

import stylesheet from stylesheet does not work if called from different directory #56

Closed gertjanvannoord closed 3 years ago

gertjanvannoord commented 3 years ago

this works with dtxslt:

dtxslt -s Scripts/plat.xsl Enhanced/wiki-1846

here, Scripts/plat.xsl imports another sylesheet (alp.basename.xsl), also from the Scripts directory.

Trying the same with alpinocorpus-xslt, I get an error:

alpinocorpus-xslt Scripts/plat.xsl Enhanced/wiki-1846 I/O warning : failed to load external entity "alp.basename.xsl" compilation error: element import xsl:import : unable to load alp.basename.xsl

too bad, since dtxslt does not know about .dact files...

danieldk commented 3 years ago

The stylesheet is read with xmlReadMemory, reading from a string. So, the parser does not have access to the actual filesystem path. This should be fixable by using a constructor that reads directly from a file. I hope to have a bit more time the coming week to make a fix.

danieldk commented 3 years ago

This should be fixed by #57. This required quite some changes since string-based stylesheets were passed quite far through the call chain. So I should probably run this through AddressSanitizer or Valgrind before merging this PR.