04.02.2013 Views

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The following example is the DOM-tree representation of the selected nodes.<br />

The data set then flattens the set of nodes into a tabular format, which the following table represents.<br />

@path @width @height<br />

sun.jpg 16 16<br />

tree.jpg 16 16<br />

surf.jpg 16 16<br />

In this instance, <strong>Spry</strong> derives the column names of the flattened table from the selected nodes and their attributes.<br />

The way <strong>Spry</strong> determines column names, however, can vary, depending on the XPath you specify.<br />

<strong>Spry</strong> uses the following guidelines when flattening data and creating columns:<br />

SPRY<br />

<strong>User</strong> <strong>Guide</strong><br />

• If the selected node has attributes, <strong>Spry</strong> creates a column for each attribute and places the value of the attribute in<br />

that column. The names for these columns are the names of the attributes preceded by an @ sign. For example, if<br />

a node has an id attribute, the column name is @id.<br />

• If the selected node has no element children, and has text or CDATA underneath it, then <strong>Spry</strong> creates a column<br />

and places that text or CDATA in that column. The name of this column is the tag name of the node for normal<br />

XML elements.<br />

• If the selected node has element children, <strong>Spry</strong> creates a column for the value of each element and its attributes,<br />

but only for each element child that has no element children of its own. The names of the columns are the tag names<br />

of the children elements, or in the case of an attribute on a child element, the format "child-<br />

TagName/@attrName".<br />

• If the selected node is an attribute, <strong>Spry</strong> creates a column for the attribute, and the column name is the name of<br />

the attribute preceded by an @ sign.<br />

• <strong>Spry</strong> ignores element children that have their own element children.<br />

Theexamplesthatfollowprovidemoredetailsontheflatteningprocessandhow<strong>Spry</strong>generatescolumnnamesfor<br />

data sets.<br />

95

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!