You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if the library could support ID and IDREF in the sense that JAXB can do with its @xmlid and @XmlIDREF where on serialization of an object tree, any field/attribute that is annotated as @XmlIDREF will emit just the field marked @xmlid from the child object (rather than the serializing the whole child object) and vice versa, on deserialising the referenced ID will be replaced with the whole child object wherever it appears. In xsdata it would seem natural to add similar xmlid and xmlidref (boolean) metadata items to the field part of the data model
At this point it should be relatively easy to alter the serialization to emit the ID, and rather less easy for the deserialisation where perhaps the most general thing to do would be to to double pass over the instantiated object tree to find the IDs and then to replace them with the actual objects.
Has anyone tried to implement this already, or has any improvements on the above ideas?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
It would be nice if the library could support ID and IDREF in the sense that JAXB can do with its @xmlid and @XmlIDREF where on serialization of an object tree, any field/attribute that is annotated as @XmlIDREF will emit just the field marked @xmlid from the child object (rather than the serializing the whole child object) and vice versa, on deserialising the referenced ID will be replaced with the whole child object wherever it appears. In xsdata it would seem natural to add similar xmlid and xmlidref (boolean) metadata items to the
fieldpart of the data modeland
At this point it should be relatively easy to alter the serialization to emit the ID, and rather less easy for the deserialisation where perhaps the most general thing to do would be to to double pass over the instantiated object tree to find the IDs and then to replace them with the actual objects.
Has anyone tried to implement this already, or has any improvements on the above ideas?
Beta Was this translation helpful? Give feedback.
All reactions