• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB repeating element inside XML  RSS feed

 
Mart Zarate
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I need help on how i would be able to have repeated element inside the XML, please see the sample XML below the text in BOLD is the element that i wanted to repeatedly insert in XML base on the number entered in parameter. Hoping to have answer from you guys soon.

Thanks in advance.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SMLMessage no-xmlns="http://www.champ.aero/broker" ver="1">
    <MessageID>JC19DM90041001</MessageID>
    <Tag>1</Tag>
    <BusinessReference>CV7721/10SEP</BusinessReference>
    <HEADER>
        <From Q="IATA">LUXXUCV</From>
    </HEADER>
    <BODY>
        <SMIorType>FFM</SMIorType>
        <Payload Q="XML">
            <FFM no-xmlns="http://www.champ.aero/broker/FFM" messageID="J215M44304431.1">
                <Type>FFM</Type>
                <Sequence>1</Sequence>
                <Flight>
                    <Carrier>CV</Carrier>
                    <Number>7721</Number>
                    <Day>10</Day>
                    <Month>SEP</Month>
                </Flight>
                <AirportOfLoading>LUX</AirportOfLoading>
                <AircraftId>LXWCV</AircraftId>
                <PointOfUnloading>
                    <Airport>BEY</Airport>
                    <ULD>
                        <Type>PMC</Type>
                        <SerialNb>21501</SerialNb>
                        <Owner>CV</Owner>
<Consignment>
                            <AWB>
<Airline>172</Airline>
<SerialNb>11111112</SerialNb>
                            </AWB>
                            <Origin>LUX</Origin>
                            <Destination>BEY</Destination>
                            <Shipped>
<Code>T</Code>
<Pieces>10</Pieces>
<Qualifier>TOTAL</Qualifier>
                            </Shipped>
                            <Weight>
<Code>K</Code>
<Amount>100</Amount>
<Qualifier>KILOS</Qualifier>
                            </Weight>
                            <NatureOfGoods>GOODS DESCRIPTION</NatureOfGoods>
                        </Consignment>

                    </ULD>
                </PointOfUnloading>
                <Part>LAST</Part>
            </FFM>
        </Payload>
    </BODY>
</SMLMessage>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!