User Guide
296 Chapter 14: Data Integration (Flash Professional Only)
In the following example, the row node represents a record within the XML file. The value of
the
id attribute is what makes the row unique.
<datapacket>
<row id="1" date="01/01/2003" rate="50" hours="5" />
<row id="2" date="02/04/2003" rate="50" hours="8" />
</datapacket>
The XPath to uniquely identify the row node is shown in the following example:
datapacket/row[@id=’xxx’]
In this example, xxx represents a value for the id attribute. In a typical case, the id attribute in
the XML file would be bound to the
id field of the DataSet component. Therefore, the
rowNodeKey value would be as follows:
datapacket/row[@id=’?id’]
The question mark symbol (?) identifies that this is a field parameter. The id value specifies
the name of the field in the data set. At runtime, the XUpdateResolver component substitutes
the value from the
id field of the data set to generate the correct XPath for the specified record.
In the next example, the contacts node with a category attribute of Management represents the
record(s) within the XML file, and the
employeeId subnode contains the value that makes the
record unique:
<datapacket>
<company id="5" name="ABC tech">
<contacts category="Mgmt">
<contact>
<empId>555</employeeId>
<name>Steve Woo</name>
<email>steve.woo@abctech.com</email>
</contact>
<contact>
<empId>382</employeeId>
<name>John Phillips</name>
<email>john.phillips@abctech.com</email>
</contact>
...
...
</contacts>
<contacts category="Executives">
...
...
</contacts>
...
...
</company>
</datapacket>
The rowNodeKey value for this XML file would be as follows:
datapacket/company/contacts[@category=’Mgmt’]/contact[empId=’?empId’]