> Werner,
>
>> How does your mapping look like ?
>
> Sorry, I thought I had included that in my post, but I had some email
> client problems last night.  My mapping looks like this:
>
>     ...
>     <field name="currentString" type="string" node="attribute">
>         <bind-xml name="type"   location="candidate/address"/>
>     </field>

Spotted the problem, I should have put the node="attribute" on bind-xml:

     <field name="currentString" type="string">
         <bind-xml name="type" node="attribute"
location="candidate/address"/>
     </field>

This is the second or third time I've had a problem like this, and I think
I've seen other posts that were caused by similar errors.  I wonder why
that seems to happen so often...

This approach works, though it's still ugly as sin. However, I'm having
some odd problems.

First, I'm not sure how this will work for parsing a similar situation
in the reply (which is similarly but not quite identically formatted).

Second, my example wasn't completely identical to the problem I'm
working on, which has two street lines.  So a more accurate example
would be:

<candidate>
     <address type="current">
         <street line="1">1600 Pennsylvnia Ave</street>
         <street line="2">Attn: Oval Office</street>
         <city>Washington</city>
         <state>DC</state>
     </address>
     <address type="previous">
         <street line="1">Governor's Mansion</street>
         <street line="2">Attn:  Governor's Office</street>
         <city>Austion</city>
         <state>TX</state>
     </address>
</candidate>

However, when I try the mapping below, it leaves off the line=""
attributes and instead sticks on an extra set of tags at the bottom:

<candidate>
     <address type="current">
         <street>1600 Pennsylvnia Ave</street>
         <street>Attn: Oval Office</street>
         <city>Washington</city>
         <state>DC</state>
     </address>
     <address type="previous">
         <street>Governor's Mansion</street>
         <street>Attn:  Governor's Office</street>
         <city>Austion</city>
         <state>TX</state>
     </address>
</candidate>
<candidate>
     <address type="current">
         <street line="1" line="2" line="1" line="2"/>
     </address>
</candidate>

Here's the mapping I'm using:

<mapping>
    <class name="com.foo.CandidateAddress">
    <map-to xml="candidate"/>

     <field name="currentString" type="string">
         <bind-xml name="type" node="attribute" location="address"/>
     </field>
     <field name="currentStreetLine1" type="string" node="text">
         <bind-xml name="line" node="attribute" location="address"/>
     </field>
     <field name="instanceStreet1" type="string" node="text">
         <bind-xml name="street" location="address"/>
     </field>
     <field name="currentStreetLine1" type="string" node="text">
         <bind-xml name="line" node="attribute" location="address"/>
     </field>
     <field name="instanceStreet2" type="string" node="text">
         <bind-xml name="street" location="address"/>
     </field>
     <field name="instanceCity" type="string" node="text">
         <bind-xml name="city"   location="address"/>
     </field>
     <field name="instanceState" type="string" node="text">
         <bind-xml name="city"   location="address"/>
     </field>

     <field name="previousString" type="string">
         <bind-xml name="type" node="attribute" location="address"/>
     </field>
     <field name="previousStreetLine1" type="string" node="text">
         <bind-xml name="line" node="attribute" location="address"/>
     </field>
     <field name="instanceStreet1" type="string" node="text">
         <bind-xml name="street" location="address"/>
     </field>
     <field name="previousStreetLine1" type="string" node="text">
         <bind-xml name="line" node="attribute" location="address"/>
     </field>
     <field name="instanceStreet2" type="string" node="text">
         <bind-xml name="street" location="address"/>
     </field>
     <field name="instanceCity" type="string" node="text">
         <bind-xml name="city"   location="address"/>
     </field>
     <field name="instanceState" type="string" node="text">
         <bind-xml name="city"   location="address"/>
     </field>
  </class>
</mapping>

Steven J. Owens
[EMAIL PROTECTED]



-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to