Project

Profile

Help

Feature #5083

closed

Saxon-JS in the browser should support data: and blob: URLs

Added by Martin Honnen about 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
High
Category:
-
Sprint/Milestone:
Start date:
2021-09-07
Due date:
% Done:

100%

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

Description

Browsers support URLs with the scheme data: or blob:, Saxon-JS in the browser should not reject such URLs but support loading resources from them as the browser APIs support that. Also, data: URLs are already supported in Saxon Java.

Use cases are e.g. xsl:import or xsl:include from a blob or data URL, for instance, if the user entered some XSLT module you want to xsl:import that would be possible with data or blob URL support. Interestingly enough, this does work with the browser's native XSLT 1.0 processor, at least as far as I have tested with Chrome and Firefox.

Test case that shows that currently it doesn't work with Saxon-JS 2.3 is at https://martin-honnen.github.io/xslt/2021/blobTest1WithSaxonJS.html (need to open F12/developer tools to see the error message about e.g. "resolve-uri: invalid URI (base=NoStylesheetBaseURI, relative=blob:https://martin-honnen.github.io/c90a3603-af63-424d-a6ec-059293e007e2)").

Client-side test case using xsl:import with a blob URL is at https://martin-honnen.github.io/xslt/2021/blobTest6.html (relevant output is also only visible if the the developer console is opened up).

Actions #1

Updated by Norm Tovey-Walsh over 2 years ago

  • Priority changed from Normal to High

Bumping the priority based on feedback from Martin

Actions #3

Updated by Norm Tovey-Walsh over 2 years ago

This turned out to be a completely different problem than I initially imagined. The browser is perfectly happy to resolve data: and blob: URIs, which I guess I should have realized. What's going on in SaxonJS is that we fail to recognize them as absolute URIs, attempt to resolve them against a base URI, and wind up with something unusable.

Simply observing that data: and blob: URIs are absolute seems to resolve the problem.

Actions #4

Updated by Norm Tovey-Walsh over 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Norm Tovey-Walsh
Actions #5

Updated by Norm Tovey-Walsh over 2 years ago

  • Status changed from In Progress to Resolved
Actions #6

Updated by Debbie Lockett about 2 years ago

  • Sprint/Milestone set to SaxonJS 2.5
  • Applies to JS Branch Trunk added
  • Fix Committed on JS Branch 2, Trunk added
Actions #7

Updated by Norm Tovey-Walsh about 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to SaxonJS 2.5

Fixed in SaxonJS 2.5.

Please register to edit this issue

Also available in: Atom PDF Tracking page