Hi Werner,
thanks for your reply sofar. Here is the entire mapping class.
<?xml version="1.0"?>
<mapping>
<class name="rulebases">
<map-to xml="rb_firewall" />
<field name="name" type="string">
<bind-xml name="name_" node="element" />
</field>
<field name="rules" collection="arraylist" type="rules">
<bind-xml name="rules" location="rules_collection" />
</field>
</class>
<class name="rules">
<!-- rule grouping -->
<field name="totalRules" type="java.lang.Long">
<bind-xml name="rb-link/totalRules" />
</field>
<field name="name" type="string">
<bind-xml name="rb-link/name" />
</field>
<field name="link" type="string">
<bind-xml name="rb-link/link" />
</field>
<field name="name" type="string">
<bind-xml name="name_" node="element" />
</field>
<field name="comments" type="string">
<bind-xml name="comments" node="element" />
</field>
<field name="enabled" type="string">
<bind-xml name="enabled" node="element" />
</field>
<!-- Action -->
<field name="actionDeny" type="string">
<bind-xml name="deny" node="element" location="action" />
</field>
<field name="actionPermit" type="string">
<bind-xml name="permit" node="element" location="action" />
</field>
<field name="actionReject" type="string">
<bind-xml name="reject" node="element" location="action" />
</field>
<!-- all in direction path -->
<field name="srcZone" type="string">
<bind-xml name="from_zone" node="element" location="direction"
/>
</field>
<field name="dstZone" type="string">
<bind-xml name="to_zone" node="element" location="direction" />
</field>
<field name="global" type="string">
<bind-xml name="global" node="element" location="direction" />
</field>
<field name="srcAddressesRaw" type="string" collection="set">
<bind-xml name="src_addr" location="src_addr_collection" />
</field>
<field name="dstAddressesRaw" type="string" collection="set">
<bind-xml name="dst_addr" location="dst_addr_collection" />
</field>
<field name="servicesRaw" type="string" collection="set">
<bind-xml name="service" location="service_collection" />
</field>
<field name="preferredId" type="java.lang.Long">
<bind-xml name="preferred-id" node="element" />
</field>
<field name="targets" type="string" collection="set">
<bind-xml name="target" location="target_collection" />
</field>
<!-- NAT -->
<field name="natDipRawId" type="string">
<bind-xml name="global-dip" node="element" location="nat-dip" />
</field>
<field name="natDstIp" type="string">
<bind-xml name="dst_ip" node="element" location="nat/nat_dst" />
</field>
<field name="natDstIpMax" type="string">
<bind-xml name="ip_max" node="element"
location="nat/nat_dst/range-or-port" />
</field>
<field name="natDstPort" type="java.lang.Long">
<bind-xml name="dst_port" node="element"
location="nat/nat_dst/range-or-port" />
</field>
</class>
</mapping>
2011/1/30 Werner Guttmann <[email protected]>
> Hi Milan,
>
>
> On 24.01.2011 22:25, Milan Kacer wrote:
>
>> Hi,
>>
>> I'm currently facing an issue with castor when parsing a XML input stream.
>> The issue is that I use the location tag to map a value from the XML
>> stream
>> but castor seems to ignore the location tag. The variable is always null.
>>
>> This is the relevant part from my mapping file. The mapping works for all
>> the other mappings - just this one is "ignored" by castor. Could the "-"
>> in
>> the location tag be the problem? If yes how can I work around this?
>>
> No not really. Can you show us the complete class mapping for MyJavaClass ?
>
> Cheers
> Werner
>
>
> <mapping>
>> <class name="MyJavaClass">
>> <map-to xml="rules" />
>> ...
>> <field name="link" type="string">
>> <bind-xml name="link" location="rb-link/link"/>
>> </field>
>> ...
>> </class>
>> </mapping>
>>
>> This is the part from the XML stream which I try to map.
>>
>> <rules>
>> ...
>> <rb-link>
>> <link>
>> <link>12.rb_firewall.1017</
>> link>
>> </link>
>> </rb-link>
>> ...
>> </rules>
>>
>> Many thanks for your help in advance.
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>