dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #02896
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 952: Made search for dxf root element more "vigorous"
------------------------------------------------------------
revno: 952
committer: Bob Jolliffe <bobj@bobj-laptop>
branch nick: trunk
timestamp: Sun 2009-11-01 21:11:55 +0000
message:
Made search for dxf root element more "vigorous"
modified:
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java 2009-10-31 01:31:57 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/importer/DefaultDXFImportService.java 2009-11-01 21:11:55 +0000
@@ -349,35 +349,29 @@
int dxfVersion = 1;
// move to root element
- reader.next();
-
- if ( reader.isStartElement( ROOT_NAME ) )
- {
- if ( reader.getXmlStreamReader().getNamespaceURI() == DXF2_NAMESPACE_URI )
- {
- dxfVersion = 2;
- log.info( "parsing dxf version " + dxfVersion );
-
- try
- {
- V2Parser v2parser = new V2Parser();
-
- v2parser.getMetadata( reader.getXmlStreamReader() );
- v2parser.getDataValues( reader.getXmlStreamReader() );
- }
- catch ( javax.xml.bind.JAXBException ex )
- {
- log.info( "Parsing error: " + ex );
- // report something to GUI ....
- }
- }
- else
- {
- dxfVersion = 1;
- parseDXFv1( params, reader );
- }
+ while (!reader.isStartElement( ROOT_NAME ) ) {
+ reader.next();
}
+ if (reader.getXmlStreamReader().getNamespaceURI() == DXF2_NAMESPACE_URI) {
+ dxfVersion = 2;
+ log.info("parsing dxf version " + dxfVersion);
+
+ try {
+ V2Parser v2parser = new V2Parser();
+
+ v2parser.getMetadata(reader.getXmlStreamReader());
+ v2parser.getDataValues(reader.getXmlStreamReader());
+ } catch (javax.xml.bind.JAXBException ex) {
+ log.info("Parsing error: " + ex);
+ // report something to GUI ....
+ }
+ } else {
+ dxfVersion = 1;
+ log.info("parsing dxf version " + dxfVersion);
+ parseDXFv1(params, reader);
+ }
+
// setMessage( "import_process_done" );
StreamUtils.closeInputStream( zipIn );