}   XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle(); if (readObj instanceof FormattedXMLDataIOStyle) { Iterator citer = ((FormattedXMLDataIOStyle) readObj).getFormatCommands().iterator(); while (citer.hasNext()) { FormattedIOCmd currentIOCmd = (FormattedIOCmd) citer.next(); if (currentIOCmd instanceof SkipCharFormattedIOCmd) { Integer bytes_to_skip = ((SkipCharFormattedIOCmd) currentIOCmd).getCount(); CurrentReadBytes += bytes_to_skip.intValue(); } } } else if (readObj instanceof DelimitedXMLDataIOStyle || readObj instanceof TaggedXMLDataIOStyle ) { throw new SAXException("Cant parse delimited or tagged data from external file (yet).");
       public Object action (SaxDocumentHandler handler, Attributes attrs)        throws SAXException       {           // we only need to do these things for the first time we enter          // a data node          if (DataNodeLevel == 0) {             // A little 'pre-handling' as href is a specialattribute             // that will hold an (Href) object rather than string value              Entity hrefObj = null;             String hrefValue = getAttributesValueByName(attrs,"href");             if (hrefValue != null )              {                // now we look up the href from the entity list gathered by                // the parser and transfer relevant info to our Href object                 hrefObj = new Entity();                Hashtable hrefInfo = (Hashtable) UnParsedEntity.get(hrefValue);/*Log.errorln("Href Entity has following keys:");java.util.Set keys = hrefInfo.keySet();Iterator iter = keys.iterator();while (iter.hasNext()) {  Log.errorln("   Key:"+iter.next().toString());}*/                if (UnParsedEntity.containsKey(hrefValue))                 {                   hrefObj.setName((String) hrefInfo.get("name"));/*                   if (hrefInfo.containsKey("base"))                       hrefObj.setBase((String) hrefInfo.get("base"));*/                   if (hrefInfo.containsKey("systemId"))                       hrefObj.setSystemId((String) hrefInfo.get("systemId"));                   if (hrefInfo.containsKey("publicId"))                       hrefObj.setPublicId((String) hrefInfo.get("publicId"));                   if (hrefInfo.containsKey("ndata"))                       hrefObj.setNdata((String) hrefInfo.get("ndata"));                } else {                   // bizarre. It usually means that the unparsed entity handler                   // isnt working like it should                   Log.error("Error: UnParsedEntity list lacks entry for :"+hrefValue);                   Log.errorln(" ignoring request to read data.");                }             }             // update the array dataCube with passed attributes             CurrentArray.getDataCube().setAttributes(attrs);             // Clean up. We override the string value of Href and set it as             // the Href object , if we created it (yeh, sloppy).              if (hrefObj != null)                 CurrentArray.getDataCube().setHref(hrefObj);             // determine the size of the dataFormat (s) in our dataCube             if (CurrentArray.hasFieldAxis()) {                 // if there is a field axis, then its set to the number of fields                 FieldAxis fieldAxis = CurrentArray.getFieldAxis();                 MaxDataFormatIndex = (fieldAxis.getLength()-1);             } else {                 // its homogeneous                  MaxDataFormatIndex = 0;             }                               // reset to start of which dataformat type we currently are reading             CurrentDataFormatIndex = 0;                 // reset to start of which IOCmd we currently are reading             CurrentIOCmdIndex = 0;                 // reset the list of dataformats we are reading             DataFormatList = CurrentArray.getDataFormatList();             NrofDataFormats = DataFormatList.length;              IntRadix = new int [NrofDataFormats];             // set up some other global information bout the dataformats             // that will help speed reading              CurrentReadBytes = 0;             for (int i=0; i < NrofDataFormats; i++) {                CurrentReadBytes += DataFormatList[i].numOfBytes();               if (DataFormatList[i] instanceof IntegerDataFormat) {                  String type = ((IntegerDataFormat) DataFormatList[i]).getType();                  if (type.equals(Constants.INTEGER_TYPE_DECIMAL))                     IntRadix[i] = 10;                   else if (type.equals(Constants.INTEGER_TYPE_HEX))                     IntRadix[i] = 16;                   else if (type.equals(Constants.INTEGER_TYPE_OCTAL))                     IntRadix[i] = 8;                   else                     IntRadix[i] = 10; // default               } else if (DataFormatList[i] instanceof BinaryIntegerDataFormat) {                     IntRadix[i] = 10;               }             }             if (CurrentReadBytes > MAXINPUTREADSIZE) {                Log.errorln("This XDF file has single record that is too big (greater than "+MAXINPUTREADSIZE+" bytes in a record) to parse by this code");                System.exit(-1);             }             // now determine properread size             CurrentInputReadSize = BASEINPUTREADSIZE * CurrentReadBytes;             // make sure its not TOO big             while (CurrentInputReadSize > MAXINPUTREADSIZE) {                CurrentInputReadSize -= CurrentReadBytes;             }          }          XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle();//          FastestAxis = (AxisInterface) CurrentArray.getAxes().get(0);//          LastFastAxisCoordinate = 0;             LastFieldAxisCoordinate = 0;          if ( readObj instanceof TaggedXMLDataIOStyle) {             TaggedLocatorObj = CurrentArray.createLocator();          } else {             // A safety. We clear datablock when this is the first datanode we              // have entered DATABLOCK is used in cases where we read in untagged data             if (DataNodeLevel == 0) DATABLOCK = new StringBuffer ();          }          // tack in href data           Entity href = CurrentArray.getDataCube().getHref();          if (href != null)               // The first method is the 'old' way.              // If you uncomment it  be sure to uncomment line that looks like:              //    if (CurrentArray.getDataCube().getHref() != null) return;              // in the end dataElementHandler              // DATABLOCK.append(getHrefData(href, CurrentArray.getDataCube().getCompression()));              loadHrefDataIntoCurrentArray(href, CurrentArray.getDataCube().getCompression());          // entered a datanode, raise the count           // this (partially helps) declare we are now reading data,           DataNodeLevel++;           return readObj;       }