Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6612389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:05:34+00:00 2026-05-25T20:05:34+00:00

guys! I need to create some sort of meta language which I could embed

  • 0

guys! I need to create some sort of meta language which I could embed in XML and then parse with Java. For example:

<code>
    [if value1>value2 then "Hello, Bob!" else "Hello, Jack"]
</code>

or

 <code>
     [if value1+2>value2 return true]
 </code>

I need to implement conditional statements,arithmetics.

Any suggestions where should I start looking?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:05:35+00:00Added an answer on May 25, 2026 at 8:05 pm

    Java has a built-in JavaScript interpreter:

    ScriptEngine jsEngine = new ScriptEngineManager().getEngineByName("JavaScript");
    jsEngine.put("value1", 8);
    jsEngine.put("value2", 9);
    String script = "if(value1 + 2 > value2) {'Foo'} else {'Bar'}";
    final Object result = jsEngine.eval(script);
    System.out.println(result);  //yields "Foo" String
    

    Of course you are free to both load the script from anywhere you need and to provide it with any context (value and value2 in this example) you want.

    See also Scripting for the Java Platform article.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi guys I got some code here thats buggin me. ive managed to create
What I'm trying to do Hello Guys, I'm trying to create a service which
Ok guys...I need to create a Alert dialog with 3 check boxes. If the
hey guys, i know how to create a simple php file that mails some
What I try to do Hello Guys, I'm trying to create a Login-Screen which
hi guys i need some help here^^ i got a tag <html> <head> function
I need to create a simple c# application to add some quarterly figures. I
I need some valuable advice from you guys... I have a UI where I
Okey guys, so as the title says, i need some help about how i
What I'm trying to do Hello Guys, I'm trying to create a SplashScreen which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.