Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sample XML and doubts about its validity

843834Oct 3 2007 — edited Oct 3 2007
Hi Friends,

I am receiving an XML from external system which I have to parse using JAXB.

Now I am the one who will be creating the schema out of the sample XML given.

Here is what it looks like:
<?xml version="1.0"?>
<Org>
    <Emp Number="137137">
        <Name>Chintan</Name>
        <LastName>Desai</LastName>
    </Emp>
    <Emp Number="118939">
        <Name>Chintan</Name>
        <LastName>Desai</LastName>
        <Name>Jabeen</Name>
        <LastName>Mohmd</LastName>
    </Emp>
</Org>
I am not sure if the generated JAXB objects will be able to handle the scenario as in the second Emp Node, I am having multiple nodes for Name and LastName and I am not sure how to distinguish between them.

I do not want to parse Sequentially (No SAX parser to be used - as my incoming XML can be as huge as 1MB to 5MB).

My question here is, Can I ask the external system to provide me a more uniform XML??

Please let me know your views on this.

Chintan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2007
Added on Oct 3 2007
0 comments
76 views