3 Replies Latest reply on Oct 12, 2007 5:15 AM by poyge394

    XStreamToObject

    poyge394

      Is this cenario possible:

      Xml File:

      
      <persons>
      <person>
       <firstname>Joe</firstname>
       <lastname>Walnes</lastname>
       <phone>
       <code>123</code>
       <number>1234-456</number>
       </phone>
      </person>
      <person>
       <firstname>Joe</firstname>
       <lastname>Walnes</lastname>
       <phone>
       <code>123</code>
       <number>1234-456</number>
       </phone>
      </person>
      <persons>
      


      I have no problem to get the first person by having configurated like this:


      configTree.setAttribute( "class-alias", "person"); configTree.setAttribute( "root-node", "/persons/person");
      configTree.setAttribute( "exclude-package", "false");
      configTree.setAttribute( "incoming-type", Person.class.getName());
      


      But offcource i dont get all the Person POJO with this configuration.

      I whant xtream to give me an collection of the Person POJO object

      I have try this:

      configTree.setAttribute( "class-alias", "person"); configTree.setAttribute( "root-node", "/persons");
      configTree.setAttribute( "exclude-package", "false");
      configTree.setAttribute( "incoming-type", Array.class.getName());
      


      But i get 0 person in my collection.

      is this cenario possible ??