My expectation is two elements, because in my task I have xml about this:
<combo-box>
<values>
<item value="First item"/>
<item value="Second item">
</values>
</combo-box>
I should correctly unmarshal this xml, I cannt change it's format.
2008/7/10 Werner Guttmann <[EMAIL PROTECTED]>:
> Sorry, can you please rephrase your statement ? What is your expectation
> ? That there is four elements, or not ?
>
> Werner
>
> Pokidov Dmitriy wrote:
> > Hi, Werner
> > No exceptions was throw, but in arraylist I have four items, but remains
> > two.
> >
> > 2008/7/10 Werner Guttmann <[EMAIL PROTECTED]>:
> >
> >> Hi,
> >>
> >> What is actually your exceptation ? I have just taken your code
> >> fragments and built a JUnit test case, and I cannot see anything wrong.
> >>
> >> Werner
> >>
> >> Pokidov Dmitriy wrote:
> >>> Hi all.
> >>>
> >>> I have simple class:
> >>> public class TestMappingClass {
> >>> List<String> texts = new ArrayList<String>();
> >>>
> >>> public List<String> getTexts() {
> >>> return texts;
> >>> }
> >>>
> >>> public void addText(String text) {
> >>> texts.add(text);
> >>> }
> >>>
> >>> public void setTexts(List<String> texts) {
> >>> this.texts = texts;
> >>> }
> >>> }
> >>>
> >>> mapping for this class:
> >>> <m:class name="test4.TestMappingClass">
> >>> <m:map-to xml="test"/>
> >>> <m:field name="texts" collection="arraylist"
> >> type="java.lang.String"
> >>> set-method="addText" get-method="getTexts">
> >>> <m:bind-xml name="value" node="attribute"
> >>> location="texts/text"/>
> >>> </m:field>
> >>> </m:class>
> >>>
> >>> and xml that I want to unmarshall:
> >>> <?xml version="1.0" encoding="Windows-1251"?>
> >>> <test>
> >>> <texts>
> >>> <text value="Hello2"/> +
> >>> <text value="Hello with space"/>
> >>> </texts>
> >>> </test>
> >>>
> >>> In unmarshall object I have four elements:
> >>> Hello2,Hello,with,space.
> >>>
> >>> How I can declare mapping to unmarshall this xml correct?
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >> http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
--
With best regards, Pokidov N. Dmitriy