Comments (3)
Only as parameters to the functions declared in the imported JSLT, I'm afraid.
Could you explain the use case?
from jslt.
Parent jslt
import "common.jslt" as common
let val1 = "someVal"
common:setVal($val1)
I want to access val1 in my common.jslt
I tried this in common.jslt
let val1 = ""
def setVal(propValue)
val1 = propValue
{
"val1" : ${val1}
}
Getting the following exception
com.schibsted.spt.data.jslt.JsltException: Parse error: Encountered " "let" "let ""
on this line
common:setVal($val1)
from jslt.
Thank you, but this is not a use case. This is a full example of trying to do this, but it gives no indication of why you might want to do something like this. The reason I asked is that it's useful to see why you wanted this in the first place. Maybe there is an easier way to achieve the same thing in the language, or maybe there is a good reason why we need to support something like this. Either the way you wanted it, or some other way.
from jslt.
Related Issues (20)
- Built-in sha256-hex function is not thread-safe HOT 6
- Unable to retrieve the values of the nested loops using JSLT HOT 1
- Pipe Operator not affecting Context HOT 3
- Complex Nesting For loop issues HOT 3
- Support for processing nested JSON
- Determine index of current item in object array HOT 3
- JsltJsonFilter clarification
- Variables, Scope and Import HOT 10
- I want to call external java method in jslt during transformation, is it possible??? HOT 3
- How to set counter value after each iteration of for loop in jslt HOT 6
- How to compare two arrays and get unique value HOT 4
- Is it possible to retrieve the common values from two arrays?i.e the values which are available in both the arrays HOT 2
- How to push elements to an array HOT 6
- How to round off value to 2 digit precision. Eg 55.0000 to 55.00 HOT 11
- Can u fix sum function precision overflow bug when double addition integer HOT 8
- Can enhance matcher expression to operate on a target specified with dot expression? HOT 2
- Need help with transforming by adding root fields to child array elements HOT 1
- json key have space HOT 1
- Filter out all keys with a specific name from all objects HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jslt.