Package nu.xom

Examples of nu.xom.XMLException


      }
    }
  }
 
  private static void throwTamperedWithParent() {
    throw new XMLException("Factory has tampered with a parent pointer " +
        "of ancestor-or-self in finishMakingElement()");
  }
View Full Code Here


//       
//        // requires xom >= 1.1
//        return new nu.xom.Namespace(
//          reader.getPrefix(), reader.getNamespaceURI(), null);
      default:
        throw new XMLException("Unrecognized event type: "
            + reader.getEventType());
    }
  }
View Full Code Here

          break;
        case XMLStreamConstants.ENTITY_REFERENCE:
          nodes = NONE; // ignore text in prolog/epilog
          break;
        default:
          throw new XMLException("Unrecognized Stax event type: "
              + reader.getEventType());
      }
     
      // append nodes:
      for (int j=0; j < nodes.size(); j++) {
View Full Code Here

        case XMLStreamConstants.CHARACTERS:
          node = readText();
          break;
         
        default:
          throw new XMLException("Unrecognized Stax event type: "
              + reader.getEventType());     
      }
     
      // assert node != null
//      if (IS_EXTENDED_XOM) { // xom-1.1 + patch // TODO
View Full Code Here

        case XMLStreamConstants.CHARACTERS:
          nodes = factory.makeText(reader.getText());
          break;
         
        default:
          throw new XMLException("Unrecognized Stax event type: "
              + reader.getEventType());
      }
     
      appendNodes(current, nodes);
    }
View Full Code Here

      }
    }
  }
 
  private static void throwTamperedWithParent() {
    throw new XMLException("Factory has tampered with a parent pointer " +
        "of ancestor-or-self in finishMakingElement()");
  }
View Full Code Here

     
      try { // StAX default
        factory = XMLInputFactory.newInstance();
        setupProperties(factory);
      } catch (IllegalArgumentException ex) {
        throw new XMLException(
            "Could not find or create a suitable StAX parser"
                + " - check your classpath", ex);
      } catch (Exception ex) {
        throw new XMLException(
            "Could not find or create a suitable StAX parser"
                + " - check your classpath", ex);
      } catch (NoClassDefFoundError ex) {
        throw new XMLException(
            "Could not find or create a suitable StAX parser"
                + " - check your classpath", ex);
      }
     
      if (DEBUG) System.err.println("using default XMLInputFactory="
View Full Code Here

   */
  public static Document toDocument(String xml) {
    try { // no need to be inefficient by default
      return BuilderPool.GLOBAL_POOL.getBuilder(false).build(xml, "");
    } catch (Exception e) { // part of the "convenience"
      throw new XMLException(e.getMessage(), e);
    }
  }
View Full Code Here

          nodes = factory.finishMakingElement(copy);
          if (nodes.size()==1 && nodes.get(0)==copy) { // same node? (common case)
            continue; // optimization: no need to remove and then readd same element
          }       
          if (result.getChildCount()-1 < 0) {
            throw new XMLException("Factory has tampered with a parent pointer " +
              "of ancestor-or-self in finishMakingElement()");
          }
          result.removeChild(result.getChildCount()-1);       
        } else if (child instanceof Text) {
          nodes = factory.makeText(child.getValue());
View Full Code Here

     
      int size = nodes.size();
      for (int i=0; i < size; i++) {
        Node node = nodes.get(i);
        if (node instanceof Attribute) {
          throw new XMLException(
          "SENR0001: W3C XQuery Serialization spec forbids top-level attributes");
//        } else if (node instanceof Namespace) {
//          throw new XMLException(
//          "SENR0001: W3C XQuery Serialization spec forbids top-level namespaces");
        } else if (node instanceof Document) {
View Full Code Here

TOP

Related Classes of nu.xom.XMLException

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.