Thanks! Will try and file an issue as soon as I can.

On Tuesday, January 25, 2022 at 2:40:23 AM UTC+1 tsalo wrote:

> On Wed, Jan 19, 2022 at 2:15 PM gapag  wrote:
>
>> Hi everyone, 
>>
>> I would like to read an XML stream with readValues, but if I wish to do 
>> something like:
>>
>>
>> *mapper.readValues("<Content><a>i1</a><b>1</b></Content><Content><a>i2</a><b>2</b></Content><Content><a>i3</a><b>3</b></Content>")*
>>
>>
>> *Find a concrete example in *
>> *https://gist.github.com/gapag/8856983e48d94b57c5c63c46dc477cbc* 
>> <https://gist.github.com/gapag/8856983e48d94b57c5c63c46dc477cbc>
>>
>>
> In theory it is possible to use a sequence, but not exactly like JSON -- 
> the problem being that XML documents' structure requires a single root 
> element (otherwise it's not valid XML document).
>
> But what you would probably need to do would be to construct 
> `FromXmlReader` (subtype of `JsonParser`) first, advance stream to the 
> first XML element of the first value, and then construct `MappingIterator` 
> from `ObjectMapper` (through `ObjectReader`).
> I have not tried this approach and I don't think the XML module has unit 
> tests to verify this all works, unfortunately.
>
> You could file an issue showing what you are trying to do, to read a value 
> sequence, and this could lead to verification of this approach, as sort of 
> "new feature" (making sure existing feature works with XML module, content).
>
> - +Tatu +-
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" 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-user/79153c4a-3653-4b3f-9ec2-3fd62b3baf9fn%40googlegroups.com.

Reply via email to