hey,
in your class file you have the varilable publicationCode but in the binding
file you are having the variable  employeeCode. how come you did not get the
binding error when you ran jibx binding generator.
You have to give the same variable that is publicationCode both in the class
file and as well as the binding xml for the data to be read correctly.
let me know how it goes...

Thanks
Karthik

On Tue, Aug 26, 2008 at 10:26 AM, AD <[EMAIL PROTECTED]> wrote:

>  Sowjanya
>
> I haven't had any luck with this , any pointers or inputs would be highhly
> appreciated
>
> Thanks
>
> On Mon, Aug 25, 2008 at 10:32 AM, AD <[EMAIL PROTECTED]> wrote:
>
>>  Sowjanya
>>
>> Let me also make it clear that this attribute is not in the child element
>> . This is in the parent element of the data.xml file.
>>
>> Ex :
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> empcode="AM">
>> <record>
>> <class>1</class>
>> <xfirstname>John UHLMAN</xfirstname>
>> <zipcode>5622041</zipcode>
>> <currtrncd>1S</currtrncd>
>> <acctnbr>542539010</acctnbr>
>> <record>
>> <employee>
>>
>>
>>
>>
>> On Mon, Aug 25, 2008 at 10:18 AM, AD <[EMAIL PROTECTED]> wrote:
>>
>>>  HI Sowjanya
>>>
>>> Thanks for your reply.
>>>
>>> this is how I have in my binding defination :
>>>
>>> <value style="attribute"  name="empcode" field="employeeCode"
>>> usage="optional"/>
>>>
>>> And its not getting me the value from my data.xml
>>>
>>> <employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
>>> " empcode="TF">
>>>
>>> Thanks for your inputs
>>> Ajay
>>>
>>>   On Mon, Aug 25, 2008 at 10:05 AM, Janga, Sowjanya <
>>> [EMAIL PROTECTED]> wrote:
>>>
>>>>    You need to specify explicitly that the portion of XML you are
>>>> trying to capture(empcode) is an attribute.
>>>>
>>>>
>>>>
>>>> <value style="attribute" name="empcode" field="publicationCode"
>>>> usage="optional" />
>>>>
>>>>
>>>>
>>>> Hope that helps.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> *From:* [EMAIL PROTECTED] [mailto:
>>>> [EMAIL PROTECTED] *On Behalf Of *AD
>>>> *Sent:* Monday, August 25, 2008 11:56 AM
>>>> *To:* JiBX users
>>>> *Subject:* [jibx-users] Attribute Access in Jibx/Java
>>>>
>>>>
>>>>
>>>> Hello Experts,
>>>>
>>>>
>>>>
>>>> How can I grab the Attribute value from an xml element tag ?
>>>>
>>>> say for example i have my element defined as  :
>>>>
>>>> <DrawBill xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>>> empcode="NQ">
>>>>
>>>> Now in my java code i would like to access EmpCode . how do i do it ?
>>>>
>>>> I have defined Empcode in Binding.xml as :
>>>>
>>>> <value name="empcode" field="publicationCode" usage="optional" />
>>>>
>>>> and in the Record.java its defined as :
>>>>
>>>> public String publicationCode; and has getters and setters :
>>>>
>>>>
>>>> Thanks
>>>>
>>>> This email message is intended only for the addressee(s) and contains 
>>>> information that may be confidential.
>>>> If you are not the intended recipient please notify the sender by reply 
>>>> email and immediately delete this message.
>>>> Use, disclosure or reproduction of this email by anyone other than the 
>>>> intended recipient(s) is strictly prohibited.
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>> challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win great
>>>> prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>> world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> jibx-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/jibx-users
>>>>
>>>>
>>>
>>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> jibx-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to