using XML tags for behavior

Lucia (archive)

Usenet Archive
Joined
Aug 7, 2003
Messages
12
Reaction score
0
Hello,

I'd like to use XML for behavior. For example an xml-file, which noted a "IF-THEN" statement.

<function name="test">
<if condition="i=0">
<function name="funexample" parameter="0">
<else>
<assin variable="i" value="i+1">
</if>
</function>

Is there any application to run these code direct in a Java class?

Till now I've found a scripting language "Simkin" using an second approach. That means, xml can incorporate behavior, if the xml file written in that form:
<function name="test2">
if (i=0){
funexample(0);
}else {
i=i+1;
};
</function>

I'd like to know if any new scripting language can be used for the first xml file?

Best regards

Lucia
 

Thomas Weidenfeller

Usenet Archive
Joined
May 25, 2000
Messages
1,555
Reaction score
0
(Lucia) writes:
<function name="test">
<if condition="i=0">
<function name="funexample" parameter="0">
<else>
<assin variable="i" value="i+1">
</if>
</function>

You are about to invent your own small scripting/programming language, just garnished with some XML. Maybe it would me more clever to just use an existing scripting language, or just the programming language you are using anyway: Java.

Or, as I have already told you in another answer, store a state transition table. It should be trivial to design some XML dtd for that purpose and it should be trivial to parse that XML into a real state transition table inside your application and feed that table into a state machine.

Oh, and that <else> element in your example needs to be closed somewhere before </if>.

/Thomas
 

Lucia (archive)

Usenet Archive
Joined
Aug 7, 2003
Messages
12
Reaction score
0
Or, as I have already told you in another answer, store a state transition table. It should be trivial to design some XML dtd for that purpose and it should be trivial to parse that XML into a real state transition table inside your application and feed that table into a state machine.

Oh, and that <else> element in your example needs to be closed somewhere before </if>.

/Thomas

Hello, Thomas,

Thank you very much for your answer. Would you pls tell me more about the state transition table?(or links) This is a totally new area for me.

best regards from Aachen

Lucia
 

Thomas Weidenfeller

Usenet Archive
Joined
May 25, 2000
Messages
1,555
Reaction score
0
Thank you very much for your answer. Would you pls tell me more about the state transition table?(or links) This is a totally new area for me.

Google is your friend. E.g. the following links looks interesting (I didn't check them). All should be about finite state machines. There are others, but FSMs should be a good start, esp. because you can ignore the math and still understand them :)

http://users.ece.gatech.edu/limsk/course/ece2030/pdfs/lec8.pdf http://class.ee.wustl.edu/ee460/sp02/Downloads/Lesson12.pdf http://www.desaware.com/Articles/StateMachineIntroL3.htm http://www.isip.msstate.edu/publications/courses/ece_7000_speech/lectures/1999/lecture_12/ http://www.research.att.com/sw/tools/fsm/tech.html http://www.microconsultants.com/tips/fsm/fsmarticl.pdf
best regards from Aachen

If you study at the RWTH, have a look at the library. It is for sure brim-full of literature about all kinds of state machines. It is a fundamental concept in computer science, and there should be thousands of textbooks, articles and research papers about them.

/Thomas
 

pete kirkham

Usenet Archive
Joined
Feb 8, 2002
Messages
61
Reaction score
0
Thomas Weidenfeller wrote:
Or, as I have already told you in another answer, store a state transition table. It should be trivial to design some XML dtd for that purpose and it should be trivial to parse that XML into a real state transition table inside your application and feed that table into a state machine.

Funnily enough, the standard exchange formats for petri nets and state machine tools has been SGML based for decades.

Pete
 

pete kirkham

Usenet Archive
Joined
Feb 8, 2002
Messages
61
Reaction score
0
Lucia wrote:
Hello,

I'd like to use XML for behavior. For example an xml-file, which noted a "IF-THEN" statement.

<function name="test">
<if condition="i=0">
<function name="funexample" parameter="0">
<else>
<assin variable="i" value="i+1">
</if>
</function>
...

Not directly, but there is applications built in Java for XSLT2 and XPath, and OWL gives you the ability to define classes.

Got the w3c for the specs, and I know of at least one person defining math functions in these languages:

http://www.xfront.com/interoperability/CanonicalForms.html

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top