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 8677943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:35:30+00:00 2026-06-12T20:35:30+00:00

My XML: <autocomplete> <url_template>http://api-public.netflix.com/catalog/titles/autocomplete?{-join|&amp;|term}</url_template> <autocomplete_item> <title short=Star Wars: Episode V: The Empire Strikes Back:

  • 0

My XML:

<autocomplete>
  <url_template>http://api-public.netflix.com/catalog/titles/autocomplete?{-join|&amp;|term}</url_template>
  <autocomplete_item>
    <title short="Star Wars: Episode V: The Empire Strikes Back: Original Theatrical Version"></title>
  </autocomplete_item>
</autocomplete>

My Objects:

public class AutoCompleteList
{
public String url_template;
public List<AutocompleteItem> autocomplete_item;
}

public class AutocompleteItem
{
public Title title;
}

public class Title
{
@XStreamAlias("short")
public String Short;
}

My code:

XStream xstream = new XStream();
xstream.alias("autocomplete", AutoCompleteList.class);
xstream.alias("title", Title.class);
AutoCompleteList myObj = (AutoCompleteList)xstream.fromXML(stringFromStream);

I am unable to retrieve the “title short” value from the XML.

Also, if my XML has more than one set of autocomplete_item tags, xstream errors out complaining that there is a duplicate instance of autocomplete_item.

Any suggestions?

I have searched through the many questions here but nothing seemed to work for me.

  • 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-06-12T20:35:31+00:00Added an answer on June 12, 2026 at 8:35 pm

    For the short attribute, try adding an @XStreamAsAttribute annotation:

    public class Title
    {
      @XStreamAlias("short")
      @XStreamAsAttribute
      public String Short;
    }
    

    and call xstream.processAnnotations(Title.class) before you call fromXML.

    For the multiple autocomplete_item issue you should use @XStreamImplicit

    public class AutoCompleteList
    {
      public String url_template;
    
      @XStreamImplicit(itemFieldName="autocomplete_item")
      public List<AutocompleteItem> autocomplete_item;
    }
    

    Again you’ll need to call xstream.processAnnotations(AutoCompleteList.class) to tell XStream to read the annotations before you can call fromXML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Check the code at http://developer.android.com/resources/tutorials/views/hello-autocomplete.html or <?xml version=1.0 encoding=utf-8?> <TextView xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:padding=10dp
xml: <workers xmlns=http://www.zoo.com xmlns:xs=http://www.w3.org/2001/XMLSchema-instance xs:schemaLocation=http://www.zoo.com worker.xsd> <impiegato> <username>mario</username> <password>de2f15d014d40b93578d255e6221fd60</password> <nome>Mario</nome> <sesso>F</sesso> <eta>23</eta> </impiegato> <impiegato>
Currently, I have this version of the autocomplete control working when returning XML from
Using jQuery UI's XML data parsed once autocomplete. I've checked the feed and it
I need an API-addressable, Java-based XML editor that is context aware. For instance, if
i was beggining to follow a tutorial on elementtree in this site http://www.bigfatalien.com/?p=223 so
I have this: $(#term).autocomplete({ minLength: 2, source: function( request, response ) { $.ajax({ url:
I have this code : $(document).ready(function(){ $(#search_input).autocomplete({ source: function(request, response) { $.ajax({ url: 'http://query.yahooapis.com/v1/public/yql',
I am using a jQuery Autocomplete but it is returning all the XML entries
Is there a way to create an autocomplete textBox using data from a xml

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.