Java XPath Expression createQueryResourcePropertiesCallBody(String aXqueryExpression)

Here you can find the source of createQueryResourcePropertiesCallBody(String aXqueryExpression)

Description

Creates the frame for SOAP message body for calling 'QueryResourceProperties' method of a service (getting metadata)

License

Open Source License

Parameter

Parameter Description
aXqueryExpression a parameter

Exception

Parameter Description
ParserConfigurationException an exception

Declaration

public static Element createQueryResourcePropertiesCallBody(String aXqueryExpression)
        throws ParserConfigurationException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import org.w3c.dom.Node;

public class Main {
    /**//from w ww. ja  va  2 s.com
     * Creates the frame for SOAP message body for calling 'QueryResourceProperties' method of a service
     *  (getting metadata)
     * @param aXqueryExpression
     * @return
     * @throws ParserConfigurationException
     */
    public static Element createQueryResourcePropertiesCallBody(String aXqueryExpression)
            throws ParserConfigurationException {

        DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
        Document doc = builder.newDocument();
        String methodName = "QueryResourceProperties";
        String parameterName = "QueryExpression";
        String nameSpace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd";
        Element methodElement = doc.createElementNS(nameSpace, methodName);
        Element parameterElement = doc.createElementNS(nameSpace, parameterName);
        parameterElement.setAttribute("Dialect", "http://www.w3.org/TR/1999/REC-xpath-19991116");
        methodElement.appendChild(parameterElement);
        Node parameter = doc.createTextNode(aXqueryExpression);
        parameterElement.appendChild(parameter);

        return methodElement;
    }
}

Related

  1. compile(String path)
  2. compileXPathExpression(String xPathExpression)
  3. constructXPathForElement(Element inElem, String xPathRest)
  4. createFactory()
  5. createNewXPath(@Nullable final NamespaceContext aNamespaceContext)
  6. createReverseCMDIComponentItemMap(String urlToComponent)
  7. createXPath()
  8. createXPath(NamespaceContext namespaceContext, XPathFunctionResolver functionResolver)
  9. createXPathExpression(NamespaceContext context, String xPathQuery)