Before you begin creating Spry data sets,
obtain the necessary files (xpath.js and SpryData.js). The xpath.js
file allows you to specify complex XPath expressions when creating
your data set; the SpryData.js file contains the Spry data library.
Link
both files to whatever HTML page you’re creating.
- Locate the Spry ZIP file on the Adobe Labs website.
- Download and unzip the Spry ZIP file to your hard drive.
- Open the unzipped Spry folder and locate the includes
folder. This folder contains the xpath.js and SpryData.js files
necessary for running the Spry framework.
- Copy the includes folder and either paste or drag a copy
of it to the root directory of your web site.
Note: If you drag the original includes folder out of the
unzipped Spry folder, the demos in the Spry folder won’t work properly.
- In Code view (View > Code), link the Spry data library
files to your web page by inserting the following script tags
within the page’s head tag:
<script type="text/javascript" src="includes/xpath.js"></script>
<script type="text/javascript" src="includes/SpryData.js"></script>
The
SpryData.js file depends on the xpath.js file, so it’s important
that the xpath.js file comes first in the code.
When you’ve
linked the Spry data library, you can create a Spry data set.
- Add the Spry name-space declaration to the HTML tag so
that the HTML tag looks as follows:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry/">
The
Spry name space declaration is necessary to validate the code.
Note: Spry
features work locally as long as the Spry data library files are
linked to your HTML page. To publish the HTML page to a live server,
upload the xpath.js and SpryData.js files as dependent files.