Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am new to XML. I want to read the following XML. Please help me on how to read the below XML in Java.

<?xml version="1.0" encoding="UTF-8"?>
<ediroot>
    <interchange Standard="EDIFACT" SyntaxId="UNOA" SyntaxVersion="4" Date="230202" Time="1019" Control="1A6824837"
                 ApplRef="APIS" Decimal=".">
        <sender>
            <address Id="XX" Qual="XX"/>
        </sender>
        <receiver>
            <address Id="XX" Qual=""/>
        </receiver>
        <group GroupType="PAXLST" ApplSender="XX" ApplSenderQual="XX" ApplReceiver="XX"
               Date="XX" Time="XX" Control="XX" StandardCode="XX" StandardVersion="XX">
            <transaction Control="1" DocType="PAXLST" Version="XX" Release="XX" Agency="XX" Association="XX"
                         AccessReference="XX">
                <segment Id="NAD">
                    <element Id="NAD01">FL</element>
                    <element Id="NAD04" Composite="yes">
                        <subelement Sequence="1">GELDIM</subelement>
                        <subelement Sequence="2">GETDIM</subelement>
                    </element>
                </segment>
            </transaction>
        </group>
    </interchange>
</ediroot>


What I have tried:

I am using JAXB for binding xml file into java objects every atrbiute values bounded my java classes but element values doesn't bind. So I want to binding also elements values (GELDIM,GETDIM) .
Posted
Comments
Richard MacCutchan 15-Mar-23 10:06am    
Please use the Improve question link above, and add complete details of what is not working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900