Project

Profile

Help

Feature #4806

closed

Transforming JSON input

Added by Michael Kay about 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Command line
Sprint/Milestone:
-
Start date:
2020-10-25
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

I propose to implement a -json option on the command line, as recently done for the Java product; this allows the principal input of the transformation to be JSON rather than XML.

To achieve this I propose to extend the SaxonJS.transform() API so that the options sourceLocation, sourceFileName, and sourceText can be JSON rather than XML; to indicate this we add another option sourceMediaType whose values can be application/xml or applicationi/jsonfor JSON, defaulting toapplication/xml`.

Note: it appears that the SaxonJS.transform() API supports a globalContextItem option that is missing from the documentation.

Actions #1

Updated by Michael Kay about 4 years ago

  • Tracker changed from Bug to Feature
  • Category set to Command line
  • Priority changed from Low to Normal
  • Applies to JS Branch Trunk added
  • Fix Committed on JS Branch Trunk added

This feature is now implemented.

The command line now accepts a -json:filename argument as an alternative to the -s argument.

The transform() API (both sync and async versions) treat sourceFileName, sourceLocation, or sourceText as JSON if the sourceType:"json" option is specified.

Actions #2

Updated by Michael Kay about 4 years ago

  • Status changed from New to Resolved
Actions #3

Updated by Debbie Lockett almost 4 years ago

  • Applies to JS Branch 2 added
  • Applies to JS Branch deleted (Trunk)
  • Fix Committed on JS Branch 2 added
  • Fix Committed on JS Branch deleted (Trunk)
Actions #5

Updated by Debbie Lockett almost 4 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