Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
peppobon opened this issue May 24, 2016 · 5 comments
Open

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

peppobon opened this issue May 24, 2016 · 5 comments

Comments

@peppobon
Copy link

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
Copy link
Contributor

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
Copy link
Author

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:load>
<p:with-option name="href" select="/tr:conf/@paths-xsl-uri">
<p:pipe port="conf" step="idml2hub"/>
/p:with-option
/p:load

<tr:paths name="paths" pipeline="test.xpl">
<p:with-option name="clades" select="$clades"/>
<p:with-option name="file" select="$file"/>
<p:with-option name="debug" select="$debug"/>
<p:with-option name="debug-dir-uri" select="$debug-dir-uri"/>
<p:with-option name="status-dir-uri" select="$status-dir-uri"/>
<p:input port="conf">
<p:pipe port="conf" step="test"/>
/p:input
/tr:paths

<tr:store-debug pipeline-step="test/paths">
<p:with-option name="active" select="$debug" />
<p:with-option name="base-uri" select="$debug-dir-uri" />
/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 name="tr:target-base-name" as="xs:string">
<xsl:param name="content" as="element(tr:content)"/>
<xsl:sequence select="$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 name="tr:target-base-name" as="xs:string">
<xsl:param name="content" as="element(tr:content)"/>
<xsl:sequence select="$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
Copy link
Contributor

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

@peppobon
Copy link
Author

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

On Wed, May 25, 2016 at 1:49 PM, Gerrit Imsieke [email protected]
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
#1 (comment)

@gimsieke
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants