highsource / highsource/jsonix

Missing properties in json after unmarshalling

Open
#270 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
369
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Hello, I came across a problem with unmarshalling process. I am attaching my xsd files and my xml file that marshalling was done upon. I am also attaching jsonschema and generated mappings. I would be grateful if you could help me, because I don't understand why unmarshalled json is (in my opinion) missing some props. XSD file that was given for jsonix to do mappings was extPL_r3.xsd.
In my xml a root element is ``````. I am having a problem with its three child props. I will start from the less deep problem.

Problem 1:
The ClinicalDocument has the `````` child tag. And the problem with this child is that in original xml it looks like this:
```<title>Skierowanie do szpitala```
And the unmarshalled equivalent in json file is:
```
"title": {
"TYPE_NAME": "referral.ST"
},
```
And marshalled version:
``````
In my opinion there should be value. I tried to pass it as string, in object etc. And nothing helped. I did find an solution by changing xsd type from "ST" to "xs:string", but I would like to avoid such an editing. Am I missing some files or something? I tried to look at referenced type of "ST" in json schema but I couldn't get a proper result.

Problem 2:
The ClinicalDocument has the `````` child tag. That tag should have a child tag: . But it does not appear in unmarshalled version.
Original xml tag looks like this:
```
...



```
Genarated json looks like this:
```
...
"code": {
"TYPE_NAME": "referral.CE",
"code": "57832-8",
"codeSystem": "2.16.840.1.113883.6.1",
"codeSystemName": "LOINC",
"displayName": "Prescription for diagnostic or specialist care Document"
},
```
There is no within.
Marshalled xml looks like this:
```

```
I think that the cause can be recursive type. But I am not sure. I tried to edit json and mapping and I didn't get proper form. Have you got any idea on that?

Problem 3:
My last problem relates to ``` tag``` This tag is placed deeply in `````` tag in ``````. Tag should be placed in ``````
The original xml looks like this:
```

```
Unmarshalled (generated) Json looks like this:
```
"text": {
"TYPE_NAME": "referral.ED"
}
```
There is no trace of `````` tag.
It took me some hours to try to solve above problems. I am asking for your help. If there will be a need for more information I will pass it to you ASAP.

files: [attachments.zip](https://github.com/highsource/jsonix/files/12290873/attachments.zip)

Thank you

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.