Archived

This topic is now archived and is closed to further replies.

XML Scripting Language?

This topic is 5597 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

XML is for data, not program flow. To use it as a scripting language would have to involve some perverse misuses of the language, in my opinion.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
AIML is far from a "scripting language" it''s a data schema. While you can write languages with XML is possible, its definitly not a good idea. You should learn more about XML and then you will understand why.

-SniperBoB-


What if The Matrix was recursive?

Share this post


Link to post
Share on other sites
quote:
Original post by Kylotan
XML is for data, not program flow. To use it as a scripting language would have to involve some perverse misuses of the language, in my opinion.

I take it you have never seen XSL/T?


"It is precisely because it is fashionable for Americans to know no science, even though they may be well educated otherwise, that they so easily fall prey to nonsense. They thus become part of the armies of the night, the purveyors of nitwittery, the retailers of intellectual junk food, the feeders on mental cardboard, for their ignorance keeps them from distinguishing nectar from sewage."
Isaac Asimov

Share this post


Link to post
Share on other sites
It''s a transformation language for XML - it transforms one XML document into another. One of the primary uses is to transform an XML data document into (X)HTML. For a decent tutorial, check [1].
Furthermore, it is (AFAIK) the only XML application in mainstream use that is Turing-complete.

[1]http://www.w3schools.com/xsl/default.asp

Share this post


Link to post
Share on other sites
I would advise you not to use XML as a scripting language. I have seen workflow done wrong by people whose career is in XML (well SGML). Expressing certain things can get messy quick. As well you''d have to write your own interpreter, which could lead to a lot of unnecessary work.

Basically XML doesn''t lend itself to scripting languages. You''d be better to use an existing scripting language, especially since many are easily embedded into programs.


University is a fountain of knowledge, and students go there to drink.

Share this post


Link to post
Share on other sites
XSL is the Devil. Debugging is a pain in the ass ("sure I''ll just step throug this XSL...wait...I can''t...crap")...it''s interpreted, slow, kludgy, iterative (not OO or procedural), and nearly impossible to maintain after a certain complexity.

Of course one of our products at work makes heavy use of XSL...and I''ve done my best to avoid learning it to prevent from being put on that team.

Please use a "standard" scripting language...I beg you.

Epolevne

Share this post


Link to post
Share on other sites
Then again, it depends on what you''re using your scripting language for. If it''s just a trigger system, or if it''s used for UI elements, or just to define game data, it''s fine. If you''re using it as a full (mostly) featured language (like Quake C, Perl, Lua, Neverwinter Night Script, Tribes script, etc.) then I would agree with everyone else.

Share this post


Link to post
Share on other sites
XML is good for simple triggers and commands.
Look at Starcraft mapedit, XML would be perfect for such a task.

You have a list of commands and a list of triggers, then you simply put any command into any trigger. Then your program just has to take all commands into all triggers and execute them accordingly.

But still, this is very limited. In fact, each trigger is very specific and each command is also specific. If you need more refinement such as selection and loop statement, forget about XML, it would be a real mess.

XML is intended to be a standard way of ordering data and if you look at my previous exemple, you will see that in fact, it''s just a cool way of ordering commands and triggers. However, look at HTML, there is no way to script anything into pure HTML. You have to use a different on-the-side language to do that, java-script. Granted, some part of the event handling and script repository is done using the HTML itself but that gets back at what I said earlier about staredit.

XML shouldn''t and mustn''t be used as a pure scripting language but still, you can use XML as a way of easily and comprehensively storing your triggers and commands. Also, when we say XML isn''t a script langhuage, it doesn''t prevent you from inserting scripts as data into XML. In fact, XML would be a perfect way of storing your little scriptlets for each objects'' event.

My little personnal-and-crappy engine uses XML for storing things such as map definition, effects and techniques (similar to Direct3DX or Quake3 shaders), blenders, generators, pixel and vertex shaders. But pure XML doesn''t and will never tell my engine how an object behaves a-la Neverwinter Nights.

Share this post


Link to post
Share on other sites
quote:
Original post by Kylotan
XML is for data, not program flow. To use it as a scripting language would have to involve some perverse misuses of the language, in my opinion.

quote:
Original post by Arild Fines
I take it you have never seen XSL/T?

XSL is a domain-specific means of specifying XML document transforms, which is a long way from a general-purpose scripting language (if that''s what the OP is after).

Share this post


Link to post
Share on other sites