Package org.jdom.xpath

Examples of org.jdom.xpath.XPath.addNamespace()


         
          String bundleName;
          Element desc = null;
          try {
            xpathDesc = XPath.newInstance("/atom:entry/oreatom:triples/rdf:Description[@rdf:about=\"" + this.URLencode(href) + "\"][1]");
            xpathDesc.addNamespace(ATOM_NS);
            xpathDesc.addNamespace(ORE_ATOM);
            xpathDesc.addNamespace(RDF_NS);
            desc = (Element)xpathDesc.selectSingleNode(doc);
          } catch (JDOMException e) {
            e.printStackTrace();
View Full Code Here


          String bundleName;
          Element desc = null;
          try {
            xpathDesc = XPath.newInstance("/atom:entry/oreatom:triples/rdf:Description[@rdf:about=\"" + this.URLencode(href) + "\"][1]");
            xpathDesc.addNamespace(ATOM_NS);
            xpathDesc.addNamespace(ORE_ATOM);
            xpathDesc.addNamespace(RDF_NS);
            desc = (Element)xpathDesc.selectSingleNode(doc);
          } catch (JDOMException e) {
            e.printStackTrace();
          }
View Full Code Here

          Element desc = null;
          try {
            xpathDesc = XPath.newInstance("/atom:entry/oreatom:triples/rdf:Description[@rdf:about=\"" + this.URLencode(href) + "\"][1]");
            xpathDesc.addNamespace(ATOM_NS);
            xpathDesc.addNamespace(ORE_ATOM);
            xpathDesc.addNamespace(RDF_NS);
            desc = (Element)xpathDesc.selectSingleNode(doc);
          } catch (JDOMException e) {
            e.printStackTrace();
          }
         
View Full Code Here

        Namespace namespace = Namespace.getNamespace("traduction", "http://www.hikage.be/schema/traduction");


        // Cr�ation des requ�te XPath pour r�cup�rer les informations
        XPath langueOrigineExpression = XPath.newInstance("//traduction:TraductionRequest/traduction:langueOrigine");
        langueOrigineExpression.addNamespace(namespace);
        XPath langueDestinationExpression = XPath.newInstance("//traduction:TraductionRequest/traduction:langueDestination");
        langueDestinationExpression.addNamespace(namespace);
        XPath texteExpression = XPath.newInstance("//traduction:TraductionRequest/traduction:texte");
        texteExpression.addNamespace(namespace);
View Full Code Here

        // Cr�ation des requ�te XPath pour r�cup�rer les informations
        XPath langueOrigineExpression = XPath.newInstance("//traduction:TraductionRequest/traduction:langueOrigine");
        langueOrigineExpression.addNamespace(namespace);
        XPath langueDestinationExpression = XPath.newInstance("//traduction:TraductionRequest/traduction:langueDestination");
        langueDestinationExpression.addNamespace(namespace);
        XPath texteExpression = XPath.newInstance("//traduction:TraductionRequest/traduction:texte");
        texteExpression.addNamespace(namespace);

        // R�cup�ration des informations � partir de la requ�te
        String langueOrigine = langueOrigineExpression.valueOf(request);
View Full Code Here

        XPath langueOrigineExpression = XPath.newInstance("//traduction:TraductionRequest/traduction:langueOrigine");
        langueOrigineExpression.addNamespace(namespace);
        XPath langueDestinationExpression = XPath.newInstance("//traduction:TraductionRequest/traduction:langueDestination");
        langueDestinationExpression.addNamespace(namespace);
        XPath texteExpression = XPath.newInstance("//traduction:TraductionRequest/traduction:texte");
        texteExpression.addNamespace(namespace);

        // R�cup�ration des informations � partir de la requ�te
        String langueOrigine = langueOrigineExpression.valueOf(request);
        String langueDestination = langueDestinationExpression.valueOf(request);
        String texteOriginal = texteExpression.valueOf(request);
View Full Code Here

   * @throws JDOMException
   */
  public static XPath getXPath(String xhtmlPrefix, String xpathExpression)
      throws JDOMException {
    XPath xpath = XPath.newInstance(xpathExpression);
    xpath.addNamespace(Namespace.getNamespace(xhtmlPrefix, XhtmlParser.XHTML_NS_URI));
    return xpath;
  }

  /**
   * Find a descendant of the given element that is an <a>
View Full Code Here

        XPath xpath = XPath.newInstance(xpathString);
       
        for ( Iterator itr = namespaces.keySet().iterator(); itr.hasNext(); )
        {
            String ns = (String) itr.next();
            xpath.addNamespace(ns, (String) namespaces.get(ns));
        }
   
        return xpath;
    }
}
View Full Code Here

    private List getMatches(Object doc, String xpath)
    {
        try
        {
            XPath path = XPath.newInstance(xpath);
            path.addNamespace("xsd", SoapConstants.XSD);
            path.addNamespace("s", SoapConstants.XSD);
            List result = path.selectNodes(doc);
            return result;
        }
        catch(JDOMException e)
View Full Code Here

    {
        try
        {
            XPath path = XPath.newInstance(xpath);
            path.addNamespace("xsd", SoapConstants.XSD);
            path.addNamespace("s", SoapConstants.XSD);
            List result = path.selectNodes(doc);
            return result;
        }
        catch(JDOMException e)
        {
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.