本文整理汇总了Java中org.springframework.xml.xpath.Jaxp13XPathTemplate类的典型用法代码示例。如果您正苦于以下问题:Java Jaxp13XPathTemplate类的具体用法?Java Jaxp13XPathTemplate怎么用?Java Jaxp13XPathTemplate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Jaxp13XPathTemplate类属于org.springframework.xml.xpath包,在下文中一共展示了Jaxp13XPathTemplate类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSoap
import org.springframework.xml.xpath.Jaxp13XPathTemplate; //导入依赖的package包/类
/**
* Returns true if the documents root is SOAP envelope.
* @param document
* @return
*/
public static boolean isSoap(Source source) {
for (String prefix: SOAP_NAMESPACES.keySet()) {
String expression = "/"+prefix+":Envelope";
Jaxp13XPathTemplate xpathTemplate = new Jaxp13XPathTemplate();
xpathTemplate.setNamespaces(SOAP_NAMESPACES);
if (xpathTemplate.evaluateAsBoolean(expression, source))
{
return true;
}
}
return false;
}
示例2: buildURLs
import org.springframework.xml.xpath.Jaxp13XPathTemplate; //导入依赖的package包/类
@Override
public List<String> buildURLs() {
List<String> urls = new ArrayList<String>();
String str = httpResourceContentFetcher.getContent(jenkinsURL + "api/xml");
Jaxp13XPathTemplate template = new Jaxp13XPathTemplate();
List<Node> nodes = template.evaluateAsNodeList("//job/url", new StringSource(str));
for (Node node : nodes) {
urls.add(node.getTextContent());
}
return urls;
}
示例3: xPathTemplate
import org.springframework.xml.xpath.Jaxp13XPathTemplate; //导入依赖的package包/类
@Bean(name = "xPathTemplate")
public XPathOperations xPathTemplate() {
return new Jaxp13XPathTemplate();
}
示例4: getXPathTemplate
import org.springframework.xml.xpath.Jaxp13XPathTemplate; //导入依赖的package包/类
@Bean(name = "xpathTempate")
public XPathOperations getXPathTemplate() {
return new Jaxp13XPathTemplate();
}
示例5: evaluateXpath
import org.springframework.xml.xpath.Jaxp13XPathTemplate; //导入依赖的package包/类
public static List<Node> evaluateXpath(final String expression, final Source source) {
Jaxp13XPathTemplate template = new Jaxp13XPathTemplate();
template.setNamespaces(getXpathNamespaces());
return template.evaluate(expression, source, returnNode);
}
示例6: isTemplate
import org.springframework.xml.xpath.Jaxp13XPathTemplate; //导入依赖的package包/类
/**
* Returns true if given message is a XSL Template.
* @param stringSource
* @return
*/
boolean isTemplate(Source context) {
Jaxp13XPathTemplate template = new Jaxp13XPathTemplate();
template.setNamespaces(NAMESPACES);
return template.evaluateAsBoolean("count(/xs:stylesheet)>0", context);
}
示例7: xpathTemplate
import org.springframework.xml.xpath.Jaxp13XPathTemplate; //导入依赖的package包/类
@Bean
public Jaxp13XPathTemplate xpathTemplate(){
return new Jaxp13XPathTemplate();
}