IBM®
Skip to main content
    United States change      Terms of use
 
 
Select a scope:    
     Home      Products      Services & industry solutions      Support & downloads      My account     
alphaWorks  >  XML  >  

Scripting for XML

A combination interpreter/editor that provides a programming environment especially appealing to new and occasional programmers.


Date Posted: November 10, 2003
Overview Requirements DownloadFAQsForum Reviews

1. Why do we need another programming language?
2. Is Scripting for XML intended for professional programmers?
3. What is Scripting for XML's intended use?
4. How does Scripting for XML add programmed behavior to applications?
5. How does Scripting for XML add dynamic behavior to XML data streams?
6. What is innovative about Scripting for XML?
7. What is innovative about the Scripting for XML editor?
8. What's wrong with the familiar tree metaphor for XML editing?
9. What are the rules for naming variables, functions, classes, methods, etc.?
10. Is the language case-sensitive? What case should I use?
11. What are the rules for literals (constants)?
12. Is the language strongly typed? What data types are supported?
13. What is the easiest way to insert a new item?
14. Can I delete TO DO blocks that I do not need?
15. How can I change the name or type of an item once it's created?
15. Why does the editor ask me if a new item is text or an element?
16. What determines whether the contents of a container are displayed horizontally or vertically?
17. How do I stop a program that is waiting for input but I've closed the console window? Or if it's in an infinite loop?
18. Where can I find further information and help?


1. Why do we need another programming language?

We need another programming language because it helps us get incrementally closer to an ideal programming language. People have been asking this question for years... They were asking it before Java. They were asking it before C++. They were asking it before C. Innovation is cumulative. Without the intermediate steps, progress would stand still.
Back to top Back to top

2. Is Scripting for XML intended for professional programmers?

Scripting for XML is not really intended for professional programmers, who have more powerful tools (such as Java, and integrated development environments such as Eclipse) at their disposal. However, the very power and complexity of these modern development tools is daunting to new or occasional programmers. Scripting for XML is intended to provide an alternative that trades power for simplicity.
Back to top Back to top

3. What is Scripting for XML's intended use?

Scripting for XML is intended to add dynamic programmed behavior to applications and XML data streams.
Back to top Back to top

4. How does Scripting for XML add programmed behavior to applications?

Scripting for XML can be embedded into applications to make them configurable by the end user. The Scripting for XML editor is one example of an interface for developing XML scripts, but it is not intended to be the only one. Scripting for XML makes an ideal intermediate language for advanced user interfaces that externalize language features in application-specific ways.
Back to top Back to top

5. How does Scripting for XML add dynamic behavior to XML data streams?

Scripting for XML programs can be embedded in XML data streams to add dynamic behavior to the static world of XML data. One example of this is with Web Services, where it is often advantageous, from a performance standpoint, to batch up several requests into a single XML document. Without a method for adding dynamic behavior to the document, the processing done by the Web Service is limited, but with the dynamic programmed behavior provided by Scripting for XML, it is possible for the XML document to decide how to control the operation once it is being processed by the Web Service (for example, retrieve this document; if it contains this data, retrieve that document).
Back to top Back to top

6. What is innovative about Scripting for XML?

Scripting for XML is an extensible, object-oriented, XML-based scripting language, with a natural tag set, a simple syntax, and a compact footprint.
Back to top Back to top

7. What is innovative about the Scripting for XML editor?

Scripting for XML Editor uses a container metaphor to highlight the relationship between program elements. This models the way we think of programs, that is, classes contain methods, methods contain statements, and statements, like a for loop, contain other statements. The container look is enhanced through 3D shading. Borders are shaded in 3D, and the deeper a container is, the darker it appears. Containers are marked with color-coded icons to make it easy to pick out groups of functions. And the container metaphor eliminates many of the syntactic aspects of programming (that is, no curly brackets, parenthesis, etc., to worry about).
Back to top Back to top

8. What's wrong with the familiar tree metaphor for XML editing?

Many XML editors use the familiar tree metaphor to display the hierarchical structure of an XML document. Although this tree metaphor has many benefits, it also has its shortcomings: it tends to create a vertically-oriented visual structure that does not take advantage of the horizontal layout of most common computer displays; it is not well-suited to displaying large or complex data for each node (such as long text strings, field/value pairs, or tables); the deeper a node is in the hierarchy, the harder it is to find and the harder it is to see its relationship to other nodes; and it emphasizes the hierarchical nature of the data as opposed to other relationships that may be present.
Back to top Back to top

9. What are the rules for naming variables, functions, classes, methods, etc.?

User-defined variable, function, class, and method names are specified using the Name built-in function. The first character of the name should be alphabetic. Any subsequent characters should be alphanumeric.
Back to top Back to top

10. Is the language case-sensitive? What case should I use?

The language is case sensitive. The names of built-in functions begin with an uppercase character. To avoid unintentional collisions with these names, all user-defined variables, functions, classes, and methods should begin with a lower-case character.
Back to top Back to top

11. What are the rules for literals (constants)?

Literals, such as numbers (for example, 100) or character strings (for example, Hello world), are specified using the Value built-in function.
Back to top Back to top

12. Is the language strongly typed? What data types are supported?

Like many scripting languages, Scripting for XML is very forgiving when it comes to data types and will generally convert internally between types as needed. Variables can contain a reference to any type, and nominally strings, integers, floating point numbers, and boolean values are all supported. Other types are passed transparently between methods as needed.
Back to top Back to top

13. What is the easiest way to insert a new item?

The easiest way to insert a new item is to select Insert from the Edit menu (or just press CTRL + i).
Back to top Back to top

14. Can I delete TO DO blocks that I do not need?

TO DO blocks are there entirely for your convenience and can be deleted when they are not needed. Delete unneeded TO DO blocks by selecting Delete from the Edit menu or by pressing the DELETE key.
Back to top Back to top

15. How can I change the name or type of an item once it's created?

Select the item and edit its properties, either by selecting Properties from the Edit menu or by pressing Alt + Enter. You can then enter a new name and/or change its type (for example, from element to text). Note that if you change an element node to text or comment, it will lose any items that it may contain.
Back to top Back to top

16. What determines whether the contents of a container are displayed horizontally or vertically?

If the number of contained items is fixed, then the contents are displayed vertically, otherwise the contents are displayed horizontally. The Block and Concatenate functions are examples of functions that may contain an arbitrary number of items, and so the contents are displayed vertically.
Back to top Back to top

17. How do I stop a program that is waiting for input but I've closed the console window? Or if it's in an infinite loop?

In the current release, if your program does not terminate as expected, close the Scripting for XML editor in order to terminate your program.
Back to top Back to top

18. Where can I find further information and help?

Further information is available in this PDF file.
Back to top Back to top
Download now Download now

Related technologies

For platform(s):
Java


 

    About IBM Privacy Contact