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

Fix variable failure from xref without format #2772

Merged
merged 1 commit into from Sep 7, 2017

Conversation

Projects
None yet
2 participants
@robander
Member

robander commented Sep 6, 2017

Signed-off-by: Robert D Anderson robander@us.ibm.com

I have an external link without a specified @format. This is to a DITA topic so defaulting to dita is fine for the value.

The topicpull step sets format with a variable, and expects an xs:string result:

<xsl:variable name="format" as="xs:string"
           select="dita-ot:get-link-format(.)"/>

However, the function call does not pass in a default, and the function itself (with or without the default) is set to return optional xs:string?. My test case below returns an empty value, and results in the build error:
[topicpull] Failed to transform document: An empty sequence is not allowed as the value of variable $format

The fix just updates the variable to expect an optional value, which is what the function already declares.

Test document:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN"  "topic.dtd">
<topic id="topic" xml:lang="en-us">
<title>Test external DITA xref</title>
<body>
<p>Try this out: <xref
href="https://www.ibm.com/support/knowledgecenter/SSFHJY_1.0.6/using/text/document/d_changing_the_default_file_format.dita"
scope="external"/></p>
</body>
</topic>
Fix variable failure from xref without format
Signed-off-by: Robert D Anderson <robander@us.ibm.com>
@jelovirt

This comment has been minimized.

Show comment
Hide comment
@jelovirt

jelovirt Sep 7, 2017

Member

The PR should go to either a bug fix branch or develop, not master. Please change the target branch.

Member

jelovirt commented Sep 7, 2017

The PR should go to either a bug fix branch or develop, not master. Please change the target branch.

@robander

This comment has been minimized.

Show comment
Hide comment
@robander

robander Sep 7, 2017

Member

Yeah, it was intended for 2.5.4 but we don't have that yet so I did it against master. I need to create the branch and fix that...

Member

robander commented Sep 7, 2017

Yeah, it was intended for 2.5.4 but we don't have that yet so I did it against master. I need to create the branch and fix that...

@jelovirt jelovirt changed the base branch from master to hotfix/2.5.4 Sep 7, 2017

@jelovirt

This comment has been minimized.

Show comment
Hide comment
@jelovirt

jelovirt Sep 7, 2017

Member

Created hotfix/2.5.4 and changed the PR to target that.

Member

jelovirt commented Sep 7, 2017

Created hotfix/2.5.4 and changed the PR to target that.

@jelovirt jelovirt added this to the 2.5.4 milestone Sep 7, 2017

@jelovirt jelovirt added the bug label Sep 7, 2017

@jelovirt jelovirt merged commit 5ea44bd into dita-ot:hotfix/2.5.4 Sep 7, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment