Examples of XPath


Examples of javax.xml.xpath.XPath

          "XPathExpression");
      try
      {
        if (xPathExpr != null)
        {
          XPath xPath = XPathFactory.newInstance().newXPath();
          String function = xPath.evaluate(xPathExpr, doc
              .getDocumentElement());
          function = XStringSupport.replaceAll(function, " ", "");
          setFunction(function);
        }
      }
View Full Code Here

Examples of javax.xml.xpath.XPath

        }
        return answer;
    }
   
    protected XPathExpression createXPathExpression() throws XPathExpressionException, XPathFactoryConfigurationException {
        XPath xPath = getXPathFactory().newXPath();

        xPath.setNamespaceContext(getNamespaceContext());
        return xPath.compile(text);
    }
View Full Code Here

Examples of javax.xml.xpath.XPath


  public Map<String, String> extractXmlNamespaces(Node contextNode)
      throws JRException {
    Map<String, String> namespaces = new HashMap<String, String>();
    XPath namespaceXPath = xpathFact.newXPath();
    String namespaceXPathString = "//namespace::*";
   

    try {
      NodeList nlist = (NodeList) namespaceXPath.evaluate(
          namespaceXPathString, contextNode, XPathConstants.NODESET);
      for (int i = 0; i < nlist.getLength(); i++) {
        Node node = nlist.item(i);
        namespaces.put(node.getNodeName().substring("xmlns:".length()),
            node.getNodeValue());
View Full Code Here

Examples of javax.xml.xpath.XPath

      replyTo += "&xoauth_end_user_decision=" + decision.toLowerCase();
      return confirmAuthorization(replyTo);
   }
  
   private String evaluateBody(InputStream body, String expression) {
       XPath xpath = XPathFactory.newInstance().newXPath();
       xpath.setNamespaceContext(new NamespaceContextImpl(
               Collections.singletonMap("ns", "http://org.jboss.com/resteasy/oauth")));
       try {
           Object result = (Object)xpath.evaluate(expression, new InputSource(body), XPathConstants.STRING);
           return (String)result;
       } catch (XPathExpressionException ex) {
           throw new IllegalArgumentException("Illegal XPath expression '" + expression + "'", ex);
       }
View Full Code Here

Examples of javax.xml.xpath.XPath

      replyTo += "&xoauth_end_user_decision=" + decision.toLowerCase();
      return confirmAuthorization(replyTo);
   }
  
   private String evaluateBody(InputStream body, String expression) {
       XPath xpath = XPathFactory.newInstance().newXPath();
       xpath.setNamespaceContext(new NamespaceContextImpl(
               Collections.singletonMap("ns", "http://org.jboss.com/resteasy/oauth")));
       try {
           Object result = (Object)xpath.evaluate(expression, new InputSource(body), XPathConstants.STRING);
           return (String)result;
       } catch (XPathExpressionException ex) {
           throw new IllegalArgumentException("Illegal XPath expression '" + expression + "'", ex);
       }
View Full Code Here

Examples of javax.xml.xpath.XPath

    try
    {
      columnTypes = new ArrayList();
      columnNames = new ArrayList();

      final XPath xPath = XPathFactory.newInstance().newXPath();
      xPath.setXPathVariableResolver(new InternalXPathVariableResolver(parameters));

      // load metadata (number of rows, row names, row types)

      final String nodeValue = computeColDeclaration(xmlResource, resourceManager, xPath);
      if (nodeValue != null)
View Full Code Here

Examples of javax.xml.xpath.XPath

    throws XPathExpressionException
  {
    XPathExpression expression = xPathExpressions.get(sExpression);
    if (null == expression)
    {
      XPath xPath = xPathFactory.newXPath();
      expression = xPath.compile(sExpression);
      xPathExpressions.put(sExpression, expression);
    }
    return expression;
  }
View Full Code Here

Examples of javax.xml.xpath.XPath

    }


    public static NodeList nodeListXpath(Node baseNode, String xpathExpression) {
        try {
            XPath xpath = XPathFactory.newInstance().newXPath();
            return (NodeList)xpath.evaluate( xpathExpression, baseNode, XPathConstants.NODESET );
        } catch (XPathExpressionException x) { throw new XmlException( x ); }   // Programmfehler
    }
View Full Code Here

Examples of net.lagerwey.xml.xpath.XPath

  }

  private boolean parseForNumber(String attributeDirectives) {
    boolean matches = false;
    try {
      XPath xpath = new XPath(new StringReader(attributeDirectives));
      matches = Boolean.TRUE.equals(xpath.evaluate(this));
    } catch (ParseException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    /*
 
View Full Code Here

Examples of org.apache.abdera.xpath.XPath

      "http://verisignlabs.com/tg/verify",
      bre, reqoptions);
    assertEquals(response.getStatus(),200);
    Document<Element> result = response.getDocument();
   
    XPath xpath = abdera.getXPath();
    assertTrue(
      xpath.booleanValueOf(
        "/Result/SignatureVerifies[text()='true']",
        result));

  }
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.