Examples of XpathException


Examples of org.w3c.dom.xpath.XPathException

  public int getSnapshotLength() throws XPathException {
 
    if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) &&
        (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) {
        String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_GET_SNAPSHOT_LENGTH, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});                       
        throw new XPathException(XPathException.TYPE_ERR,fmsg);
//        "The method getSnapshotLength cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}.
      }
     
    return m_list.getLength();
  }
View Full Code Here

Examples of org.w3c.dom.xpath.XPathException

   */
  public Node iterateNext() throws XPathException, DOMException {
    if ((m_resultType != UNORDERED_NODE_ITERATOR_TYPE) &&
        (m_resultType != ORDERED_NODE_ITERATOR_TYPE)) {
          String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});                       
      throw new XPathException(XPathException.TYPE_ERR, fmsg)
//      "The method iterateNext cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}.
//      This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."},
      }

    if (getInvalidIteratorState()) {
View Full Code Here

Examples of org.w3c.dom.xpath.XPathException

  public Node snapshotItem(int index) throws XPathException {
   
    if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) &&
        (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) {
           String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_SNAPSHOT_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)});                       
           throw new XPathException(XPathException.TYPE_ERR, fmsg);
//    "The method snapshotItem cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}.
//    This method applies only to types UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE."},
      }   
       
        Node node = m_list.item(index);
View Full Code Here

Examples of org.w3c.dom.xpath.XPathException

        //    
        // If the type is not a supported type, throw an exception and be
        // done with it!
        if (!XPathResultImpl.isValidType(type)) {
            String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)});      
            throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0}              
        }
       
        // Cache xpath context?
        XPathContext xpathSupport = new XPathContext();
       
        // if m_document is not null, build the DTM from the document
        if (null != m_doc) {
            xpathSupport.getDTMHandleFromNode(m_doc);
        }

        XObject xobj = null;
        try {
            xobj = m_xpath.execute(xpathSupport, contextNode, null);        
        } catch (TransformerException te) {
            // What should we do here?
            throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation());
        }

        // Create a new XPathResult object
        // Reuse result object passed in?
        // The constructor will check the compatibility of type and xobj and
View Full Code Here

Examples of org.w3c.dom.xpath.XPathException

      // Need to pass back exception code DOMException.NAMESPACE_ERR also.
      // Error found in DOM Level 3 XPath Test Suite.
      if(e instanceof XPathStylesheetDOM3Exception)
        throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation());
      else
        throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation());
       
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.