« Testing Tools | Main | Scripting iTunes on Windows »

Core Jelly - structuring scripts using import

Part 10 in an ongoing series about Jelly...

Here is a Jelly script that uses an import tag.
Importing scripts gives the Jelly programmer a way of including reusable snippets, or externalising content.

Let's look at it in a bit more detail:

1:<?xml version="1.0" ?>
2:<jelly xmlns="jelly:core" trim="no">
3:
4:  <import uri="aJellyScript.jelly" inherit="false" />
5:
6:</jelly>

Line 1 Identifies it as an XML 1.0 document.
Line 2 Is the root element, and it specifies that the default xml namespace uses tags from the core taglib.
Line 4 Imports the script aJellyScript.jelly relative to the current script. Since the inherit attribute is set to false, the imported script knows nothing of any variables set in the main script.
Line 6 Closes the script.

TrackBack

TrackBack URL for this entry:
http://www.multitask.com.au/mt/mt-tb.cgi/81

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)