Parsing large XML files (Airspace, Point and Route in AIXM 5.1) with xlinks using Jaxb time consuming
I am trying to parse an AIXM5.1 XML file> 50MB in size using JAXB. I can unmount this xml within a minute itself. But, when I try to iterate through a java object and get the field values in XML, it takes a huge amount of time. After analysis, I found that the xml has xlinks that internally refer to the xml fragment in the same xml, for example around 40,000 xlink links . So every time to find a specific piece of xml that is passed to the xlink, I try to iterate over the whole object. which takes time.
Sample XML snippet 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 that an element has an xlink: href attribute, it has a uuid value through that uuid, I have to find a snippet of the Airspace XML with the corresponding uuid. For example, there are 40,000+ links in xml.
When I googled for resolving xlinks via JAXB I found that JXPath is an alternative. But I could not find examples related to JXPath with inherited classes.
Please guide me if anyone has worked on this or suggested other technologies to me.
Looking forward to your help.
source to share
No one has answered this question yet
Check out similar questions: