GrazrScript Tutorial

Dealing with ampersands

You may have noticed something odd about the use of ampersands in the last page of examples. The URL that Google News wants to receive takes the form:

http://news.google.com/news?q=%subject%&output=rss

But the URL in the GrazrScript program is written as:

http://news.google.com/news?q=%subject%&output=rss

Why is & written as &? It turns out that XML's creators were obsessed with ampersands. Well, they were obsessed about a lot of things, but ampersands are right up there near the top. We're not sure why they hate ampersands so, but trust us, they do. Since GrazrScript is based on XML, it is necessary that all uses of & be written as & to be considered valid XML.

We strongly recommend use & in your own GrazrScript programs, but the language has been writtent to still work if you use &. You should realize that if & is used, your GrazrScript files will not be displayed correctly when you try viewing them directly in a Web browser. In most cases, you will see an error message. This has no impact on their running within Grazr.



Anatomy of an applicationDisplaying multiple feeds