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


Java NamespaceBinding类代码示例

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


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

示例1: namespaceProcess

import net.sf.saxon.om.NamespaceBinding; //导入依赖的package包/类
private void namespaceProcess(final XdmNode node) {
	final NodeInfo inode = node.getUnderlyingNode();
	final NamespaceBinding[] inscopeNS = inode.getDeclaredNamespaces(null);
	// NamespaceIterator.getInScopeNamespaceCodes(inode);

	if (inscopeNS.length > 0) {
		for (final NamespaceBinding ns : inscopeNS) {
			final String pfx = ns.getPrefix();
			final String uri = ns.getURI();
			this.doc.append(
					AQuiXEvent.getNamespace(QuiXCharStream.fromSequence(pfx), QuiXCharStream.fromSequence(uri)));
		}
	}

	// Careful, we're messing with the namespace bindings
	// Make sure the nameCode is right...
	// int nameCode = inode.getNameCode();
	// int typeCode = inode.getTypeAnnotation() & NamePool.FP_MASK;
	// String pfx = pool.getPrefix(nameCode);
	// String uri = pool.getURI(nameCode);

	// if (excludeDefault && "".equals(pfx) && !usesDefaultNS) {
	// nameCode = pool.allocate("", "", pool.getLocalName(nameCode));
	// }

	// tree.addStartElement(nameCode, typeCode, newNS);
	// tree.addAttributes(node);

}
 
开发者ID:Innovimax-SARL,项目名称:QuiXDM,代码行数:30,代码来源:AXdmNode2QuiXEventStreamConverter.java

示例2: getDeclaredNamespaces

import net.sf.saxon.om.NamespaceBinding; //导入依赖的package包/类
@Override
public NamespaceBinding[] getDeclaredNamespaces(NamespaceBinding[] buffer) {
       if (nodeKind == Type.ELEMENT) {
           Element elem = (Element)node;
           int size = elem.getNamespaceDeclarationCount();
           if (size == 0) {
               return new NamespaceBinding[0];
           }
           NamespaceBinding[] result = (buffer != null && size <= buffer.length ? buffer : new NamespaceBinding[size]);
           for (int i=0; i < size; i++) {
               String prefix = elem.getNamespacePrefix(i);
               String uri = elem.getNamespaceURI(prefix);
               result[i] = new NamespaceBinding(prefix, uri);
           }
           if (size < result.length) {
               result[size] = null;
           }
           return result;
       }
       return null;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:22,代码来源:NodeWrapper.java

示例3: afterPropertiesSet

import net.sf.saxon.om.NamespaceBinding; //导入依赖的package包/类
@Override
@SuppressWarnings({ CompilerWarnings.UNCHECKED })
public void afterPropertiesSet() throws Exception {
    super.afterPropertiesSet();

    this.testcases = CrigttStreamUtils.toMap(IdentifiedBean::getId, Function.identity(), LinkedHashMap::new,
        CrigttTestcaseUtils.buildTestcases(this.getTestcaseSources(), this.validateJaxbMarshaller).stream());

    TinyTree docTree = ((TinyDocumentImpl) this.doc.getUnderlyingNode()).getTree();

    for (NamespaceBinding namespaceBinding : docTree.getNamespaceBindings()) {
        String prefix;

        if (namespaceBinding != null && !this.docNamespaces.containsKey(prefix = namespaceBinding.getPrefix())) {
            this.xpathContext.declareNamespace(prefix, namespaceBinding.getURI());
        }
    }

    this.nullFlavors = Arrays.stream(NullFlavor.values()).map(NullFlavor::value).collect(Collectors.toList());
}
 
开发者ID:esacinc,项目名称:crigtt,代码行数:21,代码来源:ContextSpecificValidatorTaskImpl.java

示例4: testGetDeclaredNamespaces

import net.sf.saxon.om.NamespaceBinding; //导入依赖的package包/类
@Test
public void testGetDeclaredNamespaces() {
    try {
        rootNode.getDeclaredNamespaces(
                new NamespaceBinding[] {new NamespaceBinding("prefix", "uri")});
        fail("Exception is excepted");
    }
    catch (UnsupportedOperationException ex) {
        assertEquals(
            "Invalid exception message",
            "Operation is not supported",
            ex.getMessage());
    }
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:15,代码来源:RootNodeTest.java

示例5: namespace

import net.sf.saxon.om.NamespaceBinding; //导入依赖的package包/类
@Override
public void namespace(NamespaceBinding namespaceBinding, int properties)
		throws XPathException {
	MatchContext context = matchContext.getLast();
	if (context.matchedElement) {
		super.namespace(namespaceBinding, properties);
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:9,代码来源:PathMapFilter.java

示例6: namespace

import net.sf.saxon.om.NamespaceBinding; //导入依赖的package包/类
@Override
public void namespace(NamespaceBinding nb, int i) throws XPathException {}
 
开发者ID:cmarchand,项目名称:gaulois-pipe,代码行数:3,代码来源:FileAppenderTerminalStep.java

示例7: namespace

import net.sf.saxon.om.NamespaceBinding; //导入依赖的package包/类
@Override
public void namespace(NamespaceBinding namespaceBinding, int properties)
		throws XPathException {
	reciever.namespace(namespaceBinding, properties);
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:6,代码来源:StreamingUtils.java

示例8: getDeclaredNamespaces

import net.sf.saxon.om.NamespaceBinding; //导入依赖的package包/类
/**
 * Returns namespace array. Throws {@code UnsupportedOperationException}, because no child
 * class implements it and this method is not used for querying.
 * @param namespaceBindings namespace array
 * @return namespace array
 */
@Override
public final NamespaceBinding[] getDeclaredNamespaces(NamespaceBinding[] namespaceBindings) {
    throw throwUnsupportedOperationException();
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:11,代码来源:AbstractNode.java


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