On Sun, Nov 26, 2023 at 5:31 PM Thom Hehl <[email protected]> wrote:
>
> I didn't see a unit test covering lists in the serialize, so I wrote one and
> have attached. Would appreciate someone committing it. It passes, so this
> stuff works, but there's something about my case that's throwing it a curve.
>
> The bug exists in 2.14 and 2.15 as well as 2.16.
I am not sure what you mean by List handling not being covered:
`src/test/java/com/fasterxml/jackson/dataformat/xml/lists ` has more
than a dozen test classes covering various aspects.
But I can see if your test reproduces the issue for me (if I am
reading above right, it won't tho?)
-+ Tatu +-
>
>
>
> On Sunday, November 26, 2023 at 8:24:24 PM UTC-5 Thom Hehl wrote:
>>
>> I'm a newb with this project, although I've used jackson as a user for
>> years, but never for XML before.
>>
>> I have XML that looks like this:
>>
>> <div type="book" osisID="Obad">
>> <chapter osisID="Obad.1">
>> <verse osisID="Obad.1.1">
>> <w lemma="2377" n="1.0" morph="HNcmsc" id="31xeN">חֲז֖וֹן</w>
>>
>> I am deserializing into my Java class that looks like this:
>>
>> public class OsisVerse extends DocumentVerse {
>> @JacksonXmlElementWrapper(useWrapping = false)
>> @JacksonXmlProperty(localName = "note")
>> private List<OsisNote> osisNotes;
>> @JacksonXmlProperty(localName = "osisID")
>> private String uniqueId;
>> @JacksonXmlProperty(localName = "seg")
>> private String segment;
>> @JacksonXmlElementWrapper(useWrapping = false)
>> @JacksonXmlProperty(localName = "w")
>> private List<OsisWord> osisWords;
>>
>> and it de serializes great. (Thanks for a great product, BTW!)
>>
>> Then I make some changes and serialize it back using the same object and
>> here's the output I'm getting.
>>
>> <chapters>
>> <chapters>
>> <verse>
>> <words>
>> <words id="31yNB" lemma="l/4421" morph="HRd/Ncfsa" n="0"
>> x-source-word="לַ/מִּלְחָמָֽה">(...)</words>
>> </words>
>> <notes/>
>>
>> Note that in addition to not changing the tags back to "w", it also wrapped
>> the list in a tag called words and then only output 1 word tag.
>>
>> I have stepped through the code and watched it buffer the "w" without the
>> list header, so I'm not sure what happened after that, but I"m pulling my
>> hair out.
>>
>> If anyone wants to have a look, you can pull
>> https://github.com/ThomHehl/xlate and run SourceTextConverterTest.groovy.
>> (Spock test under gradle.)
>>
>> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "jackson-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jackson-dev/1c454ebc-9ffd-48e8-8cf1-b2ae991758c7n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups
"jackson-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jackson-dev/CAL4a10gAoOH91VyRLRVgXu_5mcLytKQbza2J3VQmzFFS-o5pNA%40mail.gmail.com.