For example, I've got something like....
<!-- XML -->
<?xml version="1.0" standalone="no"?>
<RateList>
<Rate TimeOfRate="10am" TypeOfRate="fwd3mos" Id="1">
<Date>2004-01-05</Date>
<Country UnitName="Euro">European Monetary Union</Country>
<Value InUsd="true">1.2637</Value>
</Rate>
<Rate TimeOfRate="10am" TypeOfRate="fwd3mos" Id="2">
<Date>2004-01-05</Date>
<Country UnitName="Yen">Japan</Country>
<Value InUsd="false">105.93</Value>
</Rate>
</RateList>
<!-- Mapping File. -->
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Object Mapping DTD Version 1.0//EN" "http://castor.exolab.org/mapping.dtd">
<mapping>
<description>
Description of the mapping of ForEx data from the European Central Bank.
</description>
<class name="com.wow.framework.feed.currency.frb.FedRateList">
<map-to xml="RateList" />
<field name="rates" direct="true" type="com.wow.framework.feed.currency.frb.FedRate" collection="array">
<bind-xml name="Rate" node="element"/>
</field>
</class>
<class name="com.wow.framework.feed.currency.frb.FedRate">
<field name="rateTime" direct="true" type="string">
<bind-xml name="TimeOfRate" node="attribute"/>
</field>
<field name="rateType" direct="true" type="string">
<bind-xml name="TypeOfRate" node="attribute"/>
</field>
<field name="id" direct="true" type="integer">
<bind-xml name="Id" node="attribute"/>
</field>
<field name="date" direct="true" type="string">
<bind-xml name="Date" node="element"/>
</field>
<field name="country" direct="true" type="string" required="true">
<bind-xml name="Country" node="element"/>
</field>
<field name="unitName" direct="true" type="string" required="true">
<bind-xml name="UnitName" location="Country" node="attribute"/>
</field>
<field name="value" direct="true" type="double" required="true">
<bind-xml name="Value" node="element"/>
</field>
<field name="inUSD" direct="true" type="boolean" required="true">
<bind-xml name="InUSD" location="Value" node="attribute"/>
</field>
<field name="value" direct="true" type="double" required="true">
<bind-xml name="Value" node="element"/>
</field>
</class>
</mapping>
And when used on the XML object, I can choose to EITHER extract the attribute data, OR extract the value. This obviously isn't incredibly helpful. :) I need both sets of data.
smime.p7s
Description: S/MIME cryptographic signature
