Scripting for XML
A combination interpreter/editor that provides a programming environment especially appealing to new and occasional programmers.
Date Posted: November 10, 2003
|
|
 |
 |
|
Update: November 21, 2003
Version 1.0.1: New functions and various improvements (see "Changes" section of the
updated Help PDF).
What is Scripting for XML?
Scripting for XML combines an interpreter that processes an easily-learned XML tag set with an integrated editor to provide a programming environment that is especially appealing to new and occasional programmers. Scripting for XML is
- natural, with a simple mapping of typical programming constructs to the XML world
- object-oriented, with the ability to create new user-defined objects as well as reuse existing JavaTM objects
- extensible, so that new industry- or application-specific tags can be created, even including flow-of-control constructs (for example, For or While)
- compact, with a single .jar file that can be embedded into existing applications to provided integrated scripting support.
The benefits of XML for representing data are well established: XML is an international standard; it's simple and concise; and it's easy to generate, transform, validate, and parse. Scripting for XML applies these benefits to the world of scripting, adding dynamic programmable behavior to the world of static XML data.
The Scripting for XML editor is a development environment that makes it easy to create XML scripts. XML tags are represented as "containers" and can be nested to include other containers. This container metaphor models our understanding of programming: We speak of classes that contain methods, and methods that contain blocks of statements, and a typical statement, such as a for loop, that contains other statements.
In the Scripting for XML editor, containers are marked with color-grouped icons that provide visual feedback and enable the easy location of tags. Multi-level, context-sensitive menus and "to do" items walk new users through the programming process. As users gain experience with the tag set, they can take advantage of advanced features, such as guided direct text entry, that make writing a program as easy as filling out a form.
The Scripting for XML editor eliminates many of the frustrating syntax and semantic errors that trip up new or occasional programmers. For example, there are no special characters (such as less than, greater than, slash, brackets, quotes, commas, parentheses, etc.).
The development environment supports the usual editing features, including drag and drop, undo/redo, and cut/copy/paste. Its desktop metaphor is a multiple-document interface so that multiple files can be open simultaneously, and it provides the option of automatically opening referenced files that contain errors.
How does it work?
Scripting for XML uses the industry standard Document Object Model (DOM) to parse the XML source into a tree that the interpreter executes directly. XML element tags represent variable, function, class, and method references. XML text tags represent string and numeric literals. XML comment tags represent comments.
The interpreter is essentially a functional programming engine, with an imperative programming personality. All tags are either function (or method) references, or arguments to a function (or method) invocation. Arguments are evaluated dynamically (that is, when referenced in the called function) to enable the implementation of user-defined flow of control constructs.
The interpreter uses the Java reflection APIs extensively to provide access to Java objects and methods. All of the built-in functions provided by the interpreter are methods of the Interpreter object, which can be extended to provide additional built-in functions.
Further information is available in this PDF file.
|
|
 |

|  | About the technology author(s): Anthony Stuart is a senior member of the technical staff at IBM Silicon Valley Laboratory in San Jose, CA. He joined IBM in 1993 and was responsible for developing three generations of database-driven workflow management and process control technology for the printing and mailing industry. Mr. Stuart is interested in all aspects of the software development life cycle, including analysis of customer requirements; architecture; standards; software design and development; and testing, documentation, and marketing/sales, with an emphasis on the successful development and deployment of easily-used, cost-effective, distributed systems. His passion is to develop break-through technology that solves real-world customer business problems, especially in the areas of advanced workflow, process control, computer languages, business process integration, electronic marketplaces, and relational database management systems.
| |
|
| |