transpect / cascade

Libraries to implement a transpect cascade configuration
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

paths.xsl//tr:target-base-name returns empty string #1

Open peppobon opened 8 years ago

peppobon commented 8 years ago

The function tr:target-base-name in paths.xsl returns a null string, causing an error in the calling paths.xpl.

Changing the function return value from $content/@base to $content/@name apparently solves the problem, but I don't know if this has other side effects.

Cheers

__peppo

gimsieke commented 8 years ago

In all cases that I tested, the tr:content element that was passed to the function had a base attribute. This may in part be due to the project-specific override of tr:parse-file-name(). In all the customizations that I looked at, for example in docx2jats-demo, the function produced a base attribute. Also, the fallback tr:content element for an input file that doesn’t fit in a clade contains a base attribute. This is in contrast to the default tr:parse-file-name() function that produces only a basename attribute. I think I should change this. Could you give us a file name and a config file that we can use to reproduce your issue? Or is your issue maybe just that you have a custom paths.xsl with a custom tr:parse-file-name(), and this function does not return a base attribute? We should issue an error if the function doesn’t issue a base and an ext attribute.

peppobon commented 8 years ago

Hi Gerrit, I am not using any override, so maybe there is something I am missing. Here is my test setup, where I call tr:paths passing both a clades and a file option. I don't have customized tr:parse-file-name() because I use clades.

test.xpl ...

/p:with-option /p:load /p:input /tr:paths /tr:store-debug I am calling the test.xpl passing in these file and clades options clades="publisher=pearson-it,settore=speciali,book=regondi-strade-maestre" file=/Users/peppo/Documents/py_src/updoc/updoc-transpect/00_content/pearson-it/speciali/regondi-strade-maestre/idml/regondi-strade-maestre.idml if in cascade/xsl/paths.xsl I use $content/@name /xsl:function I get the attached paths.xml which seems ok and where my clade is resolved correctly (see also the attached transpect-conf.xml) if in cascade/xsl/paths.xsl I use your stock $content/@base /xsl:function I get Message: An empty sequence is not allowed as the result of function tr:target-base-name() and indeed if I inspect $content/@name it is a '' Thanks as always, __peppo
gimsieke commented 8 years ago

I’m afraid I still cannot reproduce it. Can you send me the conf file that you’re using?

peppobon commented 8 years ago

my transpect-conf.xml was attached to my previous mail.

On Wed, May 25, 2016 at 1:49 PM, Gerrit Imsieke notifications@github.com wrote:

I’m afraid I still cannot reproduce it. Can you send me the conf file that you’re using?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/transpect/cascade/issues/1#issuecomment-221549942

gimsieke commented 8 years ago

If you commented to the issue via email and attached something, maybe the attachment didn’t make it to this page, #1 You can also send it to my le-tex mail address.