本文整理汇总了Java中net.sf.saxon.dom.ElementOverNodeInfo类的典型用法代码示例。如果您正苦于以下问题:Java ElementOverNodeInfo类的具体用法?Java ElementOverNodeInfo怎么用?Java ElementOverNodeInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ElementOverNodeInfo类属于net.sf.saxon.dom包,在下文中一共展示了ElementOverNodeInfo类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluateXPathToNode
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
public static NodeInfo evaluateXPathToNode(ElementOverNodeInfo currentElement, String xPath) {
if(xPath != null) {
try {
final SaxonNodeWrapper result = (SaxonNodeWrapper)createSaxonNodeWrapper(currentElement).evaluateXPathToNode(xPath);
if (result != null) {
return result.getNodeInfo();
} else {
return null;
}
} catch (Exception e) {
logger.error(e, e);
return null;
}
} else {
return null;
}
}
示例2: getXPathCache
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
private static XPathCache getXPathCache(ElementOverNodeInfo currentElement) {
final Configuration elementConfig = currentElement.getUnderlyingNodeInfo().getConfiguration();
if ((xPathCache == null) || (!xPathCache.isCompatible(elementConfig))) {
try {
final BookCache bookCache = BookCacheHandler.getInstance().getBookCache(new URL(currentElement.getBaseURI()));
final Configuration xPathConfig = bookCache.createConfiguration();
xPathConfig.setNamePool(elementConfig.getNamePool());
xPathConfig.setDocumentNumberAllocator(elementConfig.getDocumentNumberAllocator());
xPathCache = new XPathCache(xPathConfig);
} catch (MalformedURLException e) {
logger.error(e, e);
xPathCache = null;
}
}
return xPathCache;
}
示例3: evaluateXPathToStringList
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
public static String evaluateXPathToStringList(ElementOverNodeInfo currentElement, String xPath) {
if(xPath != null) {
try {
return String.join(KeyDef.PATH_DELIMITER, createSaxonNodeWrapper(currentElement).evaluateXPathToStringList(xPath));
} catch (Exception e) {
logger.error(e, e);
return null;
}
} else {
return null;
}
}
示例4: evaluateXPathToString
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
public static String evaluateXPathToString(ElementOverNodeInfo currentElement, String xPath) {
if(xPath != null) {
try {
return createSaxonNodeWrapper(currentElement).evaluateXPathToString(xPath);
} catch (Exception e) {
logger.error(e, e);
return null;
}
} else {
return null;
}
}
示例5: getXPathListErrorMessage
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
public static String getXPathListErrorMessage(ElementOverNodeInfo element, String xPath) {
if (xPath != null) {
try {
createSaxonNodeWrapper(element).evaluateXPathToStringList(xPath);
return null;
} catch (Exception e) {
logger.error(e, e);
return e.getMessage();
}
} else {
return null;
}
}
示例6: createKeyDef
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
public static KeyDef createKeyDef(ElementOverNodeInfo currentElement) {
try {
return KeyDef.fromNode(createSaxonNodeWrapper(currentElement));
} catch (Exception e) {
logger.error(e, e);
return null;
}
}
示例7: getXPathErrorMessage
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
public static String getXPathErrorMessage(ElementOverNodeInfo currentElement, String xPath) {
if (xPath != null) {
try {
createSaxonNodeWrapper(currentElement).evaluateXPathToString(xPath);
return null;
} catch (Exception e) {
logger.error(e, e);
return e.getMessage();
}
} else {
return null;
}
}
示例8: getXPathListErrorMessage
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
public static String getXPathListErrorMessage(ElementOverNodeInfo currentElement, String xPath) {
if (xPath != null) {
try {
createSaxonNodeWrapper(currentElement).evaluateXPathToStringList(xPath);
return null;
} catch (Exception e) {
logger.error(e, e);
return e.getMessage();
}
} else {
return null;
}
}
示例9: createSaxonNodeWrapper
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
protected static SaxonNodeWrapper createSaxonNodeWrapper(ElementOverNodeInfo currentElement) {
NodeInfo node = currentElement.getUnderlyingNodeInfo();
return new SaxonNodeWrapper(node, getXPathCache(currentElement));
}
示例10: createKeyRef
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
public static KeyRef createKeyRef(ElementOverNodeInfo element) {
NodeInfo node = element.getUnderlyingNodeInfo();
SaxonNodeWrapper nodeWrapper = new SaxonNodeWrapper(node, new XPathCache(node.getConfiguration()));
return KeyRef.fromNode(nodeWrapper);
}
示例11: getKeyDefID
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
public static String getKeyDefID(ElementOverNodeInfo element) {
return KeyDef.fromNode(createSaxonNodeWrapper(element)).getDefId();
}
示例12: afterPropertiesSet
import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
@Override
public void afterPropertiesSet() throws Exception {
this.testExprPattern = Pattern.compile(String.format(TEST_EXPR_PATTERN_FORMAT, this.doc.getUri().toString()));
IndependentContext xpathContext = new IndependentContext(this.xpathCompiler.getUnderlyingStaticContext());
Stream.of(((ElementOverNodeInfo) this.doc.getDocument().getDocumentElement()).getUnderlyingNodeInfo().getDeclaredNamespaces(null)).forEach(
ns -> xpathContext.declareNamespace(ns.getPrefix(), ns.getURI()));
xpathContext.declareNamespace(StringUtils.EMPTY, CrigttXmlNs.VALIDATE_VOCAB_STATIC_DOC_URI);
this.valueSets = new LinkedHashMap<>();
this.codes = MultiValueMap.multiValueMap(new LinkedHashMap<>());
this.namedCodes = MultiValueMap.multiValueMap(new LinkedHashMap<>());
this.codeSystemCodes = MultiValueMap.multiValueMap(new LinkedHashMap<>());
this.namedCodeSystemCodes = MultiValueMap.multiValueMap(new LinkedHashMap<>());
this.valueSetCodes = MultiValueMap.multiValueMap(new LinkedHashMap<>());
this.namedValueSetCodes = MultiValueMap.multiValueMap(new LinkedHashMap<>());
ElementOverNodeInfo systemElem;
String valueSetId, codeSystemId, codeId, codeName;
Code code;
for (XdmNode systemNode : this.xpathCompiler.evaluateNodes(SYS_NODE_XPATH_EXPR, xpathContext, this.doc)) {
this.valueSets.put(
(valueSetId =
(systemElem = ((ElementOverNodeInfo) NodeOverNodeInfo.wrap(systemNode.getUnderlyingNode())))
.getAttribute(VocabXmlNames.VALUE_SET_OID_ATTR_NAME)),
new ValueSetImpl(valueSetId, systemElem.getAttribute(VocabXmlNames.VALUE_SET_NAME_ATTR_NAME), systemElem
.getAttribute(VocabXmlNames.VALUE_SET_VERSION_ATTR_NAME)));
for (ElementOverNodeInfo codeElem : Stream.of(this.xpathCompiler.evaluateNodes(VocabXmlNames.CODE_NODE_NAME, xpathContext, systemNode))
.map(codeNode -> ((ElementOverNodeInfo) NodeOverNodeInfo.wrap(codeNode.getUnderlyingNode()))).toArray(ElementOverNodeInfo[]::new)) {
codeSystemId = codeElem.getAttribute(VocabXmlNames.CODE_SYSTEM_ATTR_NAME);
this.codes.put(new MultiKey<>(valueSetId, codeSystemId, (codeId = codeElem.getAttribute(VocabXmlNames.VALUE_ATTR_NAME))), (code =
new CodeImpl(codeId, (codeName = codeElem.getAttribute(VocabXmlNames.DISPLAY_NAME_ATTR_NAME)))));
this.namedCodes.put(new MultiKey<>(valueSetId, codeSystemId, codeName), code);
this.codeSystemCodes.put(new MultiKey<>(codeSystemId, codeId), code);
this.namedCodeSystemCodes.put(new MultiKey<>(codeSystemId, codeName), code);
this.valueSetCodes.put(new MultiKey<>(valueSetId, codeId), code);
this.namedValueSetCodes.put(new MultiKey<>(valueSetId, codeName), code);
}
}
super.afterPropertiesSet();
}