The data you want to extract from the XML data source is inside the XML tag itself.
Your XML data can be a bit more complex than a simple combination of nested tags. In the following example, the <Sales> tag makes up an item and also contains information we want to extract:
<Sales ProductName="Strings" ProductID="101" ProductColor="red" OrderQty="200" RepName="Peter" OrderDate="2009-08-18" /> <Sales ProductName="Yarn" ProductID="102" ProductColor="green" OrderQty="50" RepName="Lois" OrderDate="2009-09-06" /> <Sales ProductName="Thread" ProductID="102" ProductColor="blue" OrderQty="150" RepName="George" OrderDate="2009-11-12" />
Here is what you need to know:
Using the example data source above, to display the values of the attribute ProductName in column 1, OrderQty in column 2, and OrderDate in column 3, your <style> block would look like this. Note the use of the name property in each column. If you ever want to refer to any of the columns, such as for formula or from the klipscript, you can use these names:
<style> Sales::attribute(ProductName) { itemcol: 1; name: "products"; } Sales::attribute(OrderQty) { type: number; itemcol: 2; name: "quantity"; } Sales::attribute(OrderDate) { type: date; itemcol: 3; name: "date"; } Sales { type: item; definition: all; } </style>
Also see: Using CSS Selectors to Get the Data You Want in the Klip Developer Guide.