- Timestamp:
- 2008-12-12T15:04:56+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/util/RemoveContentBeforeRootElementXMLReader.java
r18170 r18195 18 18 19 19 //read up to the xml indicator 20 int foundBytes = 0; 21 charc = 0;20 int foundBytes = 0; 21 int c = 0; 22 22 while ( c != -1 ) { 23 23 try { 24 c = (char)ur.read();24 c = ur.read(); 25 25 } catch( Exception e ) { 26 26 System.err.println( "Exception while reading underlying Reader in RemoveContentBeforeRootElementXMLReader" ); 27 27 } 28 29 if ( c == xmlIndicator[foundBytes] ) {28 29 if ( c == (int)xmlIndicator[foundBytes] ) { 30 30 foundBytes++; 31 } else { 32 System.out.print( c ); 31 } else { 32 if ( foundBytes != 0 ) { 33 for ( int i=0; i<foundBytes; i++ ) { 34 System.out.print( (char)xmlIndicator[i] ); 35 } 33 36 foundBytes = 0; 37 } 38 if ( c != -1 ) { 39 System.out.print( (char)c ); 40 } 34 41 } 35 42 36 43 if ( foundBytes == xmlIndicator.length ) { 37 //System.out.println(); 38 return; 44 return; 39 45 } 40 46 41 47 } 48 42 49 System.err.println( "RemoveContentBeforeRootElementXMLReader:\n" + 43 "The XML being loaded was did not contain the '<?xml' string as expected" ); 44 50 "The XML being loaded did not contain the '<?xml' string as expected" ); 45 51 } 46 52
Note:
See TracChangeset
for help on using the changeset viewer.