Project

Profile

Help

Feature #5057

open

Constructing JS objects

Added by Martynas Jusevicius over 2 years ago. Updated over 1 year ago.

Status:
New
Priority:
High
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
2021-08-07
Due date:
% Done:

0%

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

Description

Hi. I cannot seem to find a native way to construct JS objects, which makes porting JS code to XSLT complicated. It think it was possible with Saxon-CE, but I might be wrong.

I know there is ixsl:eval(), but since it accepts string as parameter, how does one pass a JS object from a $var for example? It does not seem possible.

So how would I port some simple JS code like the following?

  var map = new ol.Map({
    target: 'map',
    layers: [
      new ol.layer.Tile({
        source: new ol.source.OSM()
      })
    ],
    view: new ol.View({
      center: ol.proj.fromLonLat([37.41, 8.82]),
      zoom: 4
    })
  });

https://openlayers.org/en/latest/doc/quickstart.html


Related issues

Related to SaxonJS - Feature #5530: For Saxon-JS under Node, expose global as ixsl:window() or ixsl:global()In Progress2022-05-21

Actions

Please register to edit this issue

Also available in: Atom PDF Tracking page