![]() | ![]() | ![]() | ![]() | ![]() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | ![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | ![]() | ![]() | ![]() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]()
|
How to work with wrapper elements around collectionsIntended Audience Prerequisites Basic concept Java entities Required XML output and XML schema Mapping file Intended AudienceHow to work with wrapper elements around collections. This document helps people to get familiar with the basic concepts and shows an example. PrerequisitesNone. Basic conceptWhen you have a class that holds a collection of objects of the same type, and you want to wrap the XML produced for the collection members with an additional XML artefact, then read on. Java entitiesFor example, assume you have the following Java class Foo:
Required XML output and XML schemaand you want to have Castor generate XML which looks like:
where the structure of the output is defined by the following XML schema:
Mapping filethen you would use a mapping like where the location attribute on the field mapping for children defines the wrapper XML artifact to be used:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() ![]() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |