JMPL
Java Programming Markup Language
JPML is a proposed programming language for the platform jvm (Java Virtual Machine) based on standard XML (eXtensible Markup Language).
JPML e' la proposta di un linguaggio di programmazione per la piattaforma jvm (Java Virtual Machine) basato sullo standard XML(eXtensible Markup Language).
Go to pages Sourceforge of this project >>
JPML provides for the establishment of special XML tags that correspond one to one with the language constructs of Java.
JPML prevede la definizione di appositi tag XML che corrisponderanno uno a uno con i costrutti del linguaggio java.
Construct of Java | Tag of JPML | |
package jpml.try; |
<package name="jpml.try" /> |
|
interface Example { |
<interface name="Example" > |
|
public static int main(String[] args) { |
<method type="int" name="main" |
|
if (num=3) { … } |
<if test="%{num=3}" > … </if> |
|
while (num<10) { |
<while test='%{num<10}' > |
|
/* … */ |
<!-- … --> |
Note: That content in %{ } is an expression.
Special Tag of JPML
<scriptlet>…</scriptlet>
is anticipated to insert code java in the files JPML.<scriptlet>…</scriptlet>
per inserire codice java nei file JPML.Example of the use of special tags for writing file/stream xml
<instanze type='java.io.PrintStream' var='file' >
%{new java.io.PrintStream("generated.html")}
</instanze>
<outxml out="file" xmlns:h="http://www.w3.org/1999/xhtml">
<outxml_processinginst target="xml" version="1.0" encoding="UTF-8" />
<outxml_doctype rootElement="html“
publicIdentifier="-//W3C//DTD HTML 4.01 Transitional//EN“
uRIreference="http://www.w3.org/TR/html4/loose.dtd" />
<h:html>
<h:head>
<h:meta http-equiv="Content-Type“
content="text/html; charset=ISO-8859-1" />
<h:title>Generate file</h:title>
</h:head>
<h:body>
hello word!!! 3*6=%{3*6}
<for init='%{int i=0}‘ while='%{i<5}‘ repeat='%{i++}' >
%{i*2}
</for>
</h:body>
</h:html>
</outxml>
<invoke object="file" method="flush" />
<invoke object="file" method="close" />