Package org.xml.sax

Examples of org.xml.sax.SAXException


        charBuf.setLength(0);
      }
    }
    catch (RDFParseException e) {
      throw new SAXException(e);
    }
    catch (RDFHandlerException e) {
      throw new SAXException(e);
    }
  }
View Full Code Here


        rdfParser.endElement(namespaceURI, localName, qName);
      }
    }
    catch (RDFParseException e) {
      throw new SAXException(e);
    }
    catch (RDFHandlerException e) {
      throw new SAXException(e);
    }
  }
View Full Code Here

          charBuf.append(ch, start, length);
        }
      }
    }
    catch (RDFParseException e) {
      throw new SAXException(e);
    }
    catch (RDFHandlerException e) {
      throw new SAXException(e);
    }
  }
View Full Code Here

    {
      try {
        handler.endQueryResult();
      }
      catch (TupleQueryResultHandlerException e) {
        throw new SAXException(e);
      }
    }
View Full Code Here

    {
      if (BINDING_TAG.equals(tagName)) {
        currentBindingName = atts.get(BINDING_NAME_ATT);

        if (currentBindingName == null) {
          throw new SAXException(BINDING_NAME_ATT + " attribute missing for " + BINDING_TAG + " element");
        }
      }
      else if (URI_TAG.equals(tagName)) {
        try {
          currentValue = valueFactory.createURI(text);
        }
        catch (IllegalArgumentException e) {
          // Malformed URI
          throw new SAXException(e.getMessage());
        }
      }
      else if (BNODE_TAG.equals(tagName)) {
        currentValue = valueFactory.createBNode(text);
      }
      else if (LITERAL_TAG.equals(tagName)) {
        String xmlLang = atts.get(LITERAL_LANG_ATT);
        String datatype = atts.get(LITERAL_DATATYPE_ATT);

        if (datatype != null) {
          try {
            currentValue = valueFactory.createLiteral(text, valueFactory.createURI(datatype));
          }
          catch (IllegalArgumentException e) {
            // Illegal datatype URI
            throw new SAXException(e.getMessage());
          }
        }
        else if (xmlLang != null) {
          currentValue = valueFactory.createLiteral(text, xmlLang);
        }
        else {
          currentValue = valueFactory.createLiteral(text);
        }
      }
      else if (RESULT_TAG.equals(tagName)) {
        currentSolution = new MapBindingSet(bindingNames.size());
      }
      else if (VAR_TAG.equals(tagName)) {
        String varName = atts.get(VAR_NAME_ATT);

        if (varName == null) {
          throw new SAXException(VAR_NAME_ATT + " missing for " + VAR_TAG + " element");
        }

        bindingNames.add(varName);
      }
      else if (RESULT_SET_TAG.equals(tagName)) {
        try {
          handler.startQueryResult(bindingNames);
        }
        catch (TupleQueryResultHandlerException e) {
          throw new SAXException(e);
        }
      }
    }
View Full Code Here

    public void endTag(String tagName)
      throws SAXException
    {
      if (BINDING_TAG.equals(tagName)) {
        if (currentValue == null) {
          throw new SAXException("Value missing for " + BINDING_TAG + " element");
        }

        currentSolution.addBinding(currentBindingName, currentValue);

        currentBindingName = null;
        currentValue = null;
      }
      else if (RESULT_TAG.equals(tagName)) {
        try {
          handler.handleSolution(currentSolution);
          currentSolution = null;
        }
        catch (TupleQueryResultHandlerException e) {
          throw new SAXException(e);
        }
      }
    }
View Full Code Here

            }
            return;
         }

         if (e instanceof SAXException) { // Try to find an encapsulated XmlBlasterException ...
            SAXException saxE = (SAXException)e;
            if (log.isLoggable(Level.FINE)) log.fine("SAXException: Parsing execution stopped half the way");
            Exception exc = saxE.getException();
            if (exc instanceof XmlBlasterException) {
               XmlBlasterException stop = (XmlBlasterException)exc;
               String txt = (stop.getMessage() != null && stop.getMessage().length() > 0) ? stop.getMessage() : "Error while SAX parsing";
               throw new XmlBlasterException(this.glob, ErrorCode.RESOURCE_CONFIGURATION, ME, txt, e);
            }
View Full Code Here

            // Now it's time to enter a new element state
            // with the tag name and space preserving.
            // We still do not change the curent element state.
            state = enterElementState( null, null, tagName, preserveSpace );
        } catch ( IOException except ) {
            throw new SAXException( except );
        }
    }
View Full Code Here

        throws SAXException
    {
        try {
            endElementIO( tagName );
        } catch ( IOException except ) {
            throw new SAXException( except );
        }
    }
View Full Code Here

        try {
            state = content();
            state.doCData = state.inCData = false;
            printText( chars, start, length, true, true );
        } catch ( IOException except ) {
            throw new SAXException( except );
        }
    }
View Full Code Here

TOP

Related Classes of org.xml.sax.SAXException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.