Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4044608
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:16:44+00:00 2026-05-20T13:16:44+00:00

I have a xml as below. <list> <map> <map name=CLAIM_TICKET_1> <val name=CLAIM_TICKET_Groups>Kalyan</val> <val name=Testing>Ram</val>

  • 0

I have a xml as below.

<list>
    <map>
    <map name="CLAIM_TICKET_1">
    <val name="CLAIM_TICKET_Groups">Kalyan</val>
    <val name="Testing">Ram</val>
    </map>
    <map name="CLAIM_TICKET_2">
    <val name="CLAIM_TICKET_Groups">Raju</val>
    <val name="Testing">Varma</val>
    </map>
    </list>

I trying to retrieve that as Map object using digester.

I want output as:

As list of Map objects.

{CLAIM_TICKET_1={CLAIM_TICKET_Groups=Kalyan,Testing=Ram},
CLAIM_TICKET_2={CLAIM_TICKET_Groups=Raju,Testing=Varma}}

My Code shows error:

String Xpath = “map/map”;

digester.addObjectCreate(Xpath, HashMap.class);
    digester.addCallMethod(Xpath , "put", 2);
    digester.addCallParam(Xpath, 0, "name");        

    digester.addObjectCreate(Xpath, HashMap.class);
    digester.addCallMethod(Xpath+"/val" , "put", 2);
    digester.addCallParam(Xpath+"/val", 0, "name");        
    digester.addCallParam(Xpath+"/val", 1);

    digester.addSetNext(Xpath+"/val", "put"); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T13:16:45+00:00Added an answer on May 20, 2026 at 1:16 pm
        String Xpath = "map/map";
    //For every occurence of list/map add map object to list object
        digester.addObjectCreate("list/map", ArrayList.class);
    
        digester.addObjectCreate(Xpath, HashMap.class);
        digester.addCallMethod(Xpath+"/val" , "put", 2);
        digester.addCallParam(Xpath+"/val", 0, "name");        
        digester.addCallParam(Xpath+"/val", 1);
    
    digester.addSetNext("list/map", "add"); 
    
    
    It works fine.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a xml data as below: <list> <com.domain.Products> <cla__id> <cname>class1</cname> <id>1</id> </cla__id> <name>pname1</name>
I have defined a List View in xml as below <ListView android:id=@+id/mylist android:layout_width=fill_parent android:layout_height=wrap_content
Say I have an xml document consisting of a list as shown below: <Items>
I have a Xml such as below: <Phrase Entry=ID> <Ans number=1> <Identification LastName=Bornery Name=John
i have xml file like Below and Device class and i want get List<Device>
I have an xml as below < Image>ImageValue1 <Type>png</Type> <Value>ImageValue1</ Value> </ Image> Here
I have an xml string below that I've turned into an object using $content
I have an xml file likes below. <?xml version=1.0 encoding=utf-8 ?> <Book> <Title>Title</Title> <Content>Content</Content>
I have a xml file as below: <?xml version=1.0 encoding=UTF-8 standalone=no?> <RULES> <RULE DESCRIPTION=
i have an xml file sitemap.xml as shown below ..i need to add one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.