Created
March 26, 2014 23:31
-
-
Save tuchida/9796167 to your computer and use it in GitHub Desktop.
E4X in Nashorn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.script.ScriptEngine; | |
import javax.script.ScriptEngineManager; | |
public class E4X { | |
public static void main(String[] args) { | |
System.out.println("E4X: " + System.getProperty("nashorn.lexer.xmlliterals")); | |
ScriptEngineManager manager = new ScriptEngineManager(); | |
ScriptEngine engine = manager.getEngineByName("js"); | |
try { | |
engine.eval("<xml>xml</xml>"); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment