当前位置: 首页>>代码示例>>Java>>正文


Java ElementOverNodeInfo类代码示例

本文整理汇总了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;
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:18,代码来源:SchematronUtil.java

示例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;
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:17,代码来源:SchematronUtil.java

示例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;
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:13,代码来源:SchematronUtil.java

示例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;
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:13,代码来源:SchematronUtil.java

示例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;
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:14,代码来源:AdvancedKeyRefSchematronUtil.java

示例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;
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:9,代码来源:ImplicitKeyDefSchematronUtil.java

示例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;
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:14,代码来源:ImplicitKeyDefSchematronUtil.java

示例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;
	}
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:14,代码来源:ImplicitKeyDefSchematronUtil.java

示例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));
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:5,代码来源:SchematronUtil.java

示例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);
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:6,代码来源:AdvancedKeyRefSchematronUtil.java

示例11: getKeyDefID

import net.sf.saxon.dom.ElementOverNodeInfo; //导入依赖的package包/类
public static String getKeyDefID(ElementOverNodeInfo element) {
	return KeyDef.fromNode(createSaxonNodeWrapper(element)).getDefId();
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:4,代码来源:ImplicitKeyDefSchematronUtil.java

示例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();
}
 
开发者ID:esacinc,项目名称:crigtt,代码行数:50,代码来源:StaticVocabServiceImpl.java


注:本文中的net.sf.saxon.dom.ElementOverNodeInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。