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


Java NamespaceConstant类代码示例

本文整理汇总了Java中net.sf.saxon.lib.NamespaceConstant的典型用法代码示例。如果您正苦于以下问题:Java NamespaceConstant类的具体用法?Java NamespaceConstant怎么用?Java NamespaceConstant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NamespaceConstant类属于net.sf.saxon.lib包,在下文中一共展示了NamespaceConstant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getNamespaceURI

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
public String getNamespaceURI(String prefix){
  switch (prefix) {
    case SaxonEnvironment.FOX_NS_PREFIX:
      return SaxonEnvironment.FOX_NS_URI;
    case Mod.FOX_MODULE_NS_PREFIX:
      return Mod.FOX_MODULE_URI;
    case SaxonEnvironment.XML_SCHEMA_NS_PREFIX:
      return NamespaceConstant.SCHEMA;
    case FO_PREFIX:
      return FO_URI;
    case MATH_PREFIX:
      return MATH_URI;
    case FN_PREFIX:
      return FN_URI;
    default:
      return "";
  }
}
 
开发者ID:Fivium,项目名称:FOXopen,代码行数:19,代码来源:DefaultNamespaceContext.java

示例2: isContained

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
private boolean isContained(TestAssertion assertion, String fileLocation)
		throws XPathExpressionException,
		XPathFactoryConfigurationException, XPathException {
	XPathFactory xpathFactory = XPathFactory
			.newInstance(NamespaceConstant.OBJECT_MODEL_SAXON);
	XPathEvaluator xpath = (XPathEvaluator) xpathFactory.newXPath();
	xpath.getConfiguration().setLineNumbering(true);
	xpath.setNamespaceContext(new BpelNamespaceContext());
	XPathExpression expr = xpath.compile(assertion.getTarget());
	InputSource inputSource = new InputSource(
			new File(fileLocation).toString());
	SAXSource saxSource = new SAXSource(inputSource);
	NodeInfo doc = xpath.getConfiguration().buildDocument(saxSource);

	@SuppressWarnings("unchecked")
	List<NodeInfo> matchedLines = (List<NodeInfo>) expr.evaluate(doc,
			XPathConstants.NODESET);
	if (matchedLines.size() > 0) {
		return true;
	}

	return false;
}
 
开发者ID:uniba-dsg,项目名称:bpp,代码行数:24,代码来源:TestRunner.java

示例3: getPrefix

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
public String getPrefix(String namespace){
  if(Mod.FOX_MODULE_URI.equals(namespace)) {
    return Mod.FOX_MODULE_NS_PREFIX;
  }
  else if (NamespaceConstant.SCHEMA.equals(namespace)){
    return SaxonEnvironment.XML_SCHEMA_NS_PREFIX;
  }
  else if (FO_URI.equals(namespace)){
    return FO_PREFIX;
  }
  else {
    return SaxonEnvironment.FOX_NS_PREFIX;
  }
}
 
开发者ID:Fivium,项目名称:FOXopen,代码行数:15,代码来源:DefaultNamespaceContext.java

示例4: createXPathEvaluator

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
private void createXPathEvaluator()
		throws XPathFactoryConfigurationException {
	XPathFactory xpathFactory = XPathFactory
			.newInstance(NamespaceConstant.OBJECT_MODEL_SAXON);
	xpath = (XPathEvaluator) xpathFactory.newXPath();
	xpath.getConfiguration().setLineNumbering(true);
	xpath.setNamespaceContext(new BpmnNamespaceContext());
}
 
开发者ID:uniba-dsg,项目名称:prope,代码行数:9,代码来源:XPathNodeCounter.java

示例5: AdaptabilityAnalyzer

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
public AdaptabilityAnalyzer() {
	System.setProperty("javax.xml.xpath.XPathFactory:" + NamespaceConstant.OBJECT_MODEL_SAXON,
               "net.sf.saxon.xpath.XPathFactoryImpl");
	nodeCounter = new XPathNodeCounter();
	inspector = new BpmnInspector();

	testMetrics = new ArrayList<>(5);
	testMetrics.add(new BinaryAdaptabilityMetric(0.2));
	testMetrics.add(new BinaryAdaptabilityMetric(0.4));
	testMetrics.add(new BinaryAdaptabilityMetric(0.6));
	testMetrics.add(new BinaryAdaptabilityMetric(0.8));
	testMetrics.add(new WeightedAdaptabilityMetric());
}
 
开发者ID:uniba-dsg,项目名称:prope,代码行数:14,代码来源:AdaptabilityAnalyzer.java

示例6: beforeClass

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() {
	System.setProperty("javax.xml.xpath.XPathFactory:"
			+ NamespaceConstant.OBJECT_MODEL_SAXON,
			"net.sf.saxon.xpath.XPathFactoryImpl");
	elements = new AdaptableElements().getElementsByName();
}
 
开发者ID:uniba-dsg,项目名称:prope,代码行数:8,代码来源:ElementXPathTests.java

示例7: isContained

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
private boolean isContained(AdaptableElement element, String fileLocation) {
	try {
		XPathFactory xpathFactory = XPathFactory
				.newInstance(NamespaceConstant.OBJECT_MODEL_SAXON);
		XPathEvaluator xpath = (XPathEvaluator) xpathFactory.newXPath();
		xpath.getConfiguration().setLineNumbering(true);
		xpath.setNamespaceContext(new BpmnNamespaceContext());
		XPathExpression expr = xpath
				.compile(element.getLocatorExpression());
		InputSource inputSource = new InputSource(
				new File(fileLocation).toString());
		SAXSource saxSource = new SAXSource(inputSource);
		NodeInfo doc = xpath.getConfiguration().buildDocument(saxSource);;

		@SuppressWarnings("unchecked")
		List<NodeInfo> matchedLines = (List<NodeInfo>) expr.evaluate(doc,
				XPathConstants.NODESET);
		if (matchedLines.size() > 0) {
			return true;
		}

		return false;
	} catch (XPathFactoryConfigurationException | XPathExpressionException
			| XPathException e) {
		e.printStackTrace();
		return false;
	}
}
 
开发者ID:uniba-dsg,项目名称:prope,代码行数:29,代码来源:ElementXPathTests.java

示例8: setPrefixNamespaceMappings

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
/**
 * Set the namespaces in the XPathCompiler.
 * 
 * @param xpathCompiler
 * @param namespaceMappings Namespace prefix to Namespace uri mappings
 */
private  void setPrefixNamespaceMappings(XPathCompiler xpathCompiler, HashMap<String,String> namespaceMappings) {

	if (namespaceMappings != null) {
		
		// Get the mappings
		Set<Entry<String, String>> mappings = namespaceMappings.entrySet();		
	
		// If mappings exist, set the namespaces
		if (mappings != null) {
		
			Iterator<Entry<String, String>> it = mappings.iterator();
			while (it.hasNext()) {
				Entry<String, String> entry = it.next();
				xpathCompiler.declareNamespace(entry.getKey(), entry.getValue());					
			}
			
		}
		
	}
	
	// Add in the defaults	
	xpathCompiler.declareNamespace("xml",NamespaceConstant.XML);
	xpathCompiler.declareNamespace("xs",NamespaceConstant.SCHEMA);
	xpathCompiler.declareNamespace("fn",NamespaceConstant.FN);

}
 
开发者ID:elsevierlabs-os,项目名称:spark-xml-utils,代码行数:33,代码来源:XPathProcessor.java

示例9: setPrefixNamespaceMappings

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
/**
 * Set the namespaces in the XQueryCompiler.
 * 
 * @param xqueryCompiler
 * @param namespaceMappings Namespace prefix to Namespace uri mappings
 */
private  void setPrefixNamespaceMappings(XQueryCompiler xqueryCompiler, HashMap<String,String> namespaceMappings) {

	if (namespaceMappings != null) {
		
		// Get the mappings
		Set<Entry<String, String>> mappings = namespaceMappings.entrySet();

		// If mappings exist, set the namespaces
		if (mappings != null) {
		
			Iterator<Entry<String, String>> it = mappings.iterator();
			while (it.hasNext()) {
				Entry<String, String> entry = it.next();
				xqueryCompiler.declareNamespace(entry.getKey(),entry.getValue());
			}
		
		}	
		
	}
	
	// Add in the defaults
	xqueryCompiler.declareNamespace("xml",NamespaceConstant.XML);
	xqueryCompiler.declareNamespace("xs",NamespaceConstant.SCHEMA);
	xqueryCompiler.declareNamespace("fn",NamespaceConstant.FN);
	
}
 
开发者ID:elsevierlabs-os,项目名称:spark-xml-utils,代码行数:33,代码来源:XQueryProcessor.java

示例10: createXPathEvaluator

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
private void createXPathEvaluator()
		throws XPathFactoryConfigurationException {
	XPathFactory xpathFactory = XPathFactory
			.newInstance(NamespaceConstant.OBJECT_MODEL_SAXON);
	xpath = (XPathEvaluator) xpathFactory.newXPath();
	xpath.getConfiguration().setLineNumbering(true);
	xpath.setNamespaceContext(new BpelNamespaceContext());
}
 
开发者ID:lenhard,项目名称:pete,代码行数:9,代码来源:XPathNodeCounter.java

示例11: isContained

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
private boolean isContained(AdaptableElement element, String fileLocation) {
	try {
		XPathFactory xpathFactory = XPathFactory
				.newInstance(NamespaceConstant.OBJECT_MODEL_SAXON);
		XPathEvaluator xpath = (XPathEvaluator) xpathFactory.newXPath();
		xpath.getConfiguration().setLineNumbering(true);
		xpath.setNamespaceContext(new BpmnNamespaceContext());
		XPathExpression expr = xpath
				.compile(element.getLocatorExpression());
		InputSource inputSource = new InputSource(
				new File(fileLocation).toString());
		SAXSource saxSource = new SAXSource(inputSource);
		NodeInfo doc = xpath.setSource(saxSource);

		@SuppressWarnings("unchecked")
		List<NodeInfo> matchedLines = (List<NodeInfo>) expr.evaluate(doc,
				XPathConstants.NODESET);
		if (matchedLines.size() > 0) {
			return true;
		}

		return false;
	} catch (XPathFactoryConfigurationException | XPathExpressionException
			| XPathException e) {
		e.printStackTrace();
		return false;
	}
}
 
开发者ID:lenhard,项目名称:pete,代码行数:29,代码来源:ElementXPathTests.java

示例12: initXpathFactory

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
private static XPathFactory initXpathFactory() {
    try {
        sysinit();
        return XPathFactory.newInstance(NamespaceConstant.OBJECT_MODEL_SAXON);
    } catch (Exception e) {
        return die("initXpathFactory: "+e, e);
    }
}
 
开发者ID:cobbzilla,项目名称:cobbzilla-utils,代码行数:9,代码来源:XPath2.java

示例13: sysinit

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
private static void sysinit () {
    synchronized (initialized) {
        if (!initialized.get()) {
            final String name = "javax.xml.xpath.XPathFactory:" + NamespaceConstant.OBJECT_MODEL_SAXON;
            System.setProperty(name, "net.sf.saxon.xpath.XPathFactoryImpl");
            initialized.set(true);
        }
    }
}
 
开发者ID:cobbzilla,项目名称:cobbzilla-utils,代码行数:10,代码来源:XPath2.java

示例14: FileAnalyzer

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
public FileAnalyzer(String filePath, boolean isStrict) {
	System.setProperty("javax.xml.xpath.XPathFactory:" + NamespaceConstant.OBJECT_MODEL_SAXON,
               "net.sf.saxon.xpath.XPathFactoryImpl");
	this.isStrict = isStrict;
	createRawResult(filePath);
	try {
		createXPathEvaluator();
		createSourceDocument(filePath);
	} catch (XPathFactoryConfigurationException | XPathException e) {
		throw new AnalysisException(e);
	}

}
 
开发者ID:uniba-dsg,项目名称:bpp,代码行数:14,代码来源:FileAnalyzer.java

示例15: beforeClass

import net.sf.saxon.lib.NamespaceConstant; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() {
	System.setProperty("javax.xml.xpath.XPathFactory:"
			+ NamespaceConstant.OBJECT_MODEL_SAXON,
			"net.sf.saxon.xpath.XPathFactoryImpl");
}
 
开发者ID:uniba-dsg,项目名称:prope,代码行数:7,代码来源:XPathNodeCounterTests.java


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