Project

Profile

Help

Bug #4590

closed

xsl:result-document writing to file containing spaces

Added by Michael Kay over 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Command line
Sprint/Milestone:
-
Start date:
2020-06-14
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
2
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

When the base output URI used for xsl:result-document represents a directory with spaces in its name, the result document is written to a path with %20 in the name, e.g. c:/My%Documents

Actions #1

Updated by Michael Kay over 4 years ago

See writeFileAsync in NodeJSPlatform line 302. We are using url.pathname to convert the URI to a filename, and this is not decoding %HH escape sequences.

Actions #2

Updated by Michael Kay over 4 years ago

First attempt to find a solution led me to the npm package filenamify, which purports to convert URIs to filenames. But as far as I can see, it doesn't decode %HH escape sequences.

The module at https://github.com/TooTallNate/file-uri-to-path looks a better bet, judging by the examples.

But most of its work is done using decode-uri(), which is a global function, and which we could probably use directly.

Actions #3

Updated by Michael Kay over 4 years ago

  • Applies to JS Branch 2.0 added
  • Fix Committed on JS Branch Trunk added

Fixed by putting the output URI's pathname through the decodeURIComponent function in NodeJSPlatform methods writeFile and writeFileAsync.

Actions #4

Updated by Michael Kay over 4 years ago

  • Status changed from New to Resolved
Actions #5

Updated by Community Admin almost 4 years ago

  • Applies to JS Branch 2 added
  • Applies to JS Branch deleted (2.0)
Actions #6

Updated by Debbie Lockett almost 4 years ago

  • Fix Committed on JS Branch 2 added
  • Fix Committed on JS Branch deleted (Trunk)
Actions #7

Updated by Debbie Lockett over 3 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 2.1

Bug fix applied in the Saxon-JS 2.1 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page