4

I am trying to parse an AIXM5.1 xml file of size >50 MB using JAXB. I am able to unmarshal this xml within a minute itself. But, when I try to iterate through the java object and fetching values of the fields in XML it is taking huge time. After analyzing I found that the xml has xlinks which internally refer to an xml fragment with in the same xml, like there are around 40000 xlink references are there. So everytime for finding the specific xml fragment which is referred in xlink I am trying to iterate through the whole object. which is taking time.

Sample xml fragment is as below

<aixm:geometryComponent>
<aixm:AirspaceGeometryComponent gml:id="ID_2903_1384156119164_17492"><aixm:operation>BASE</aixm:operation>
<aixm:theAirspaceVolume>
<aixm:AirspaceVolume gml:id="ID_2903_1384156119164_17493">
<aixm:upperLimit uom="FL">30</aixm:upperLimit><aixm:upperLimitReference>STD</aixm:upperLimitReference>
<aixm:lowerLimit uom="FT">GND</aixm:lowerLimit><aixm:lowerLimitReference>MSL</aixm:lowerLimitReference>
<aixm:contributorAirspace>
<aixm:AirspaceVolumeDependency gml:id="ID_2903_1384156119164_17494"><aixm:dependency>HORZ_PROJECTION</aixm:dependency>
**<aixm:theAirspace xlink:href="urn:uuid:1c49634e-62ea-4319-bf80-23f3912cef8e">**</aixm:theAirspace>
</aixm:AirspaceVolumeDependency>
</aixm:contributorAirspace>
</aixm:AirspaceVolume>
</aixm:theAirspaceVolume>
</aixm:AirspaceGeometryComponent>
</aixm:geometryComponent>

If you observe element has a xlink:href attribute it has uuid value through this uuid I have to find out the Airspace xml fragment with the matching uuid. Like this there are 40000+ references exist in the xml.

When I googled to resolve xlinks through JAXB I found that JXPath i an alternative. But I could not find the examples pertaining to JXPath with inherited classes.

Please guide me if anybody worked on it or suggest me any other technologies.

Looking forward for your help..

Rachel McGuigan
  • 511
  • 4
  • 22
shivaram
  • 41
  • 4

0 Answers0