Questions tagged [xmlmapper]

XMLMapper is a third-party library for mapping XML to objects written in Swift.

XMLMapper is a third-party library for mapping XML to objects written in Swift.

Questions about how to use this library should have this tag.

To learn more visit the source of the project on Github

72 questions
0
votes
0 answers

Jackson XML - change tag according to the property type

How can I change a root tag from a property according to the class type of a property? Consider this code: public class Animal { private String name; } public class Dog extends Animal { } public class Cat extends Animal { } public class Person…
marciel.deg
  • 400
  • 3
  • 17
0
votes
1 answer

How would I marshal/ unmarshal a List of java objects to an XML without a root element?

I have a List of java objects with structure as follows @XmlRootElement(name = "employee") @XmlAccessorType (XmlAccessType.FIELD) public class Employee { private Integer id; private String firstName; private String lastName; private double…
0
votes
0 answers

Jackson - How to add different formatting to a specific Date field?

I'm working on a project where they used a serializer to convert data fields: public static class DateSerializer extends JsonSerializer { private static final DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); …
marciel.deg
  • 400
  • 3
  • 17
0
votes
0 answers

Jackson handling XML arrays with dynamic fields using the hashmap approach

I have to write a message handler that will process incoming XML messages and pass them on to another module as JSON representations. There are a relatively high of possible messages and I would rather use a single POJO for my purpose. Here is an…
0
votes
0 answers

Not able to add XML mapper for the XML input Object : Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.dataformat.xml.XmlMapper

after searching for a while, I cannot get the correct version of the Jackson jar and what Jackson jars I need to use. I am not able to get the exact solution tried adding all the applicable jars for the same but my application has not started. Using…
0
votes
1 answer

XmlMapper: read XML values without assigning a class for the created objects

I am trying to implement a multi language interface for my project and for this I want to load the data for the 3 languages from XML file. The problem is that when I want to read values I can only do it with readValue(file,MyClass.class) which I do…
Andrei
  • 41
  • 6
0
votes
2 answers

Deserialize XML containing Properties and Values with Jackson

I'm trying to deserialize the following XML. 003 001 ... RM1 I…
Nimila Hiranya
  • 4,842
  • 10
  • 35
  • 52
0
votes
1 answer

XML Mapper to Pojo - Only Subelements?

i want to deserialize XML to a Java Pojo, but i dont need all elements and i want to avoid creating boilerplate-wrapper classes just to get some subelements The XML looks like this NotInterestingValue InterestingValue
Martinek
  • 11
  • 2
0
votes
1 answer

Expected END_ELEMENT, got event of type 1 (through reference chain: ...->java.util.ArrayList[0])

I'm using XMLMapper to deserialize AIML code (mostly the same as XML) and got this problem when I mix text and tags under the same tag. Example: FUNCTION1 FUNCTION2 My java…
PabloG
  • 1
  • 1
0
votes
3 answers

Most Efficient way to create XML from java List object

i am working on converting CSV to XML, though i have many ways to do this but my requirement is to do it in such a way that in future the mapping can be changed without any code change. so we are using the following approach. we are using Apache…
Umesh Awasthi
  • 23,407
  • 37
  • 132
  • 204
0
votes
1 answer

Jackson XmlMaaper fails to decode null Double

I’m experiencing a strange Jackson issue. The XmlMapper could not deserialize what is serialized by itself. And the error only occurs when there’re nulls in the Double array. A sample test case to reproduce the issue is below: @Test public void…
0
votes
0 answers

SerializationFeature.WRITE_DATES_WITH_ZONE_ID is not giving me the expected result

I am using below code to convert java object having DateTime varible to xml string. However I am expecting the output as 2020-08-13T16:26:00.000-05:00 but it is getting converted to 2020-08-13T16:26:00.000-05:00[-05:00]. XmlMapper xmlMapper = new…
manoj n p
  • 1
  • 2
0
votes
2 answers

Jackson XmlMapper serialize nested object @JacksonXmlProperty(isAttribute = true) doesn't work correctly

I have a problem with Jackson to serialize nested object. @Data @AllArgsConstructor @NoArgsConstructor @JacksonXmlRootElement(localName = "A") public class A { @JacksonXmlProperty(isAttribute = true) private String Iee; …
0
votes
1 answer

Binding a child object of an XmlElement list to a Java object using Jackson XmlMapper

Given the following xml: This Schedule 20190328 /v2/schedule schedule 2019-03-28T21:51:41+0
James Murphy
  • 800
  • 1
  • 15
  • 29
0
votes
1 answer

XmlMapper to write XML with repeating element

I am using XmlMapper to write a XML file using POJO. I want my xml to look like :
1 2
user1631306
  • 4,350
  • 8
  • 39
  • 74