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


Java Type.ATTRIBUTE属性代码示例

本文整理汇总了Java中net.sf.saxon.type.Type.ATTRIBUTE属性的典型用法代码示例。如果您正苦于以下问题:Java Type.ATTRIBUTE属性的具体用法?Java Type.ATTRIBUTE怎么用?Java Type.ATTRIBUTE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.sf.saxon.type.Type的用法示例。


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

示例1: initializeNodeInfo

private void initializeNodeInfo(@Nullable NodeInfo nodeInfo) {
    if (nodeInfo == null) {
        return;
    }

    int nodeKind = nodeInfo.getNodeKind();
    NodeInfo elemInfo = null;

    if (nodeKind == Type.ATTRIBUTE) {
        this.attrQname = new QName(nodeInfo.getPrefix(), nodeInfo.getURI(), nodeInfo.getLocalPart());

        elemInfo = nodeInfo.getParent();
    } else if (nodeKind == Type.ELEMENT) {
        elemInfo = nodeInfo;
    }

    if (elemInfo == null) {
        return;
    }

    this.elemQname = new QName(elemInfo.getPrefix(), elemInfo.getURI(), elemInfo.getLocalPart());
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:22,代码来源:SdcctLocation.java

示例2: processArc

void processArc(PathMapArc arc) {
	NodeTest test = arc.getNodeTest();
	if (test == null) {
		addAnyNodeArc(arc);
	} else {
		switch (test.getPrimitiveType()) {
		case Type.TEXT:
			matchesText = true;
		case Type.NODE:
			addAnyNodeArc(arc);
			break;
		case Type.COMMENT:
			matchesComment = true;
			break;
		case Type.ELEMENT:
			addElementArc(arc);
			break;
		case Type.ATTRIBUTE:
			addAttributeArc(arc);
			break;
		}
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:23,代码来源:PathMapFilter.java

示例3: NodeWrapper

/**
 * This constructor is protected: nodes should be created using the wrap
 * factory method on the DocumentWrapper class
 *
 * @param node
 *            The XOM node to be wrapped
 * @param parent
 *            The NodeWrapper that wraps the parent of this node
 * @param index
 *            Position of this node among its siblings
 */
protected NodeWrapper(Node node, NodeWrapper parent, int index) {
	short kind;
	if (node instanceof Element) {
		kind = Type.ELEMENT;
	} else if (node instanceof Text) {
		kind = Type.TEXT;
	} else if (node instanceof Attribute) {
		kind = Type.ATTRIBUTE;
	} else if (node instanceof Comment) {
		kind = Type.COMMENT;
	} else if (node instanceof ProcessingInstruction) {
		kind = Type.PROCESSING_INSTRUCTION;
	} else if (node instanceof Document) {
		kind = Type.DOCUMENT;
	} else {
		throwIllegalNode(node); // moved out of fast path to enable better inlining
		return; // keep compiler happy
	}
	this.nodeKind = kind;
	this.node = node;
	this.parent = parent;
	this.index = index;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:34,代码来源:NodeWrapper.java

示例4: FollowingEnumeration

public FollowingEnumeration(NodeImpl node, NodeTest nodeTest) 
{
  super(node, nodeTest);
  root = (LazyDocument)node.getDocumentRoot();

  // skip the descendant nodes if any
  int type = node.getNodeKind();
  if (type == Type.ATTRIBUTE || type == Type.NAMESPACE) 
  {
    next = ((NodeImpl)node.getParent()).getNextInDocument(root);
  }
  else {
    do {
      next = (NodeImpl)node.getNextSibling();
      if (next == null)
        node = (NodeImpl)node.getParent();
    } while (next == null && node != null);
  }
  while (!conforms(next)) {
    step();
  }
}
 
开发者ID:CDLUC3,项目名称:dash-xtf,代码行数:22,代码来源:FollowingEnumeration.java

示例5: getAttributeNamesOfNamespace

@Override
public List<String> getAttributeNamesOfNamespace(String namespaceUri) {
	final List<String> list = new LinkedList<String>();
	if (isElement()) {
		final NodeTest 		nodeTest	= new NamespaceTest(saxonNode.getNamePool(), Type.ATTRIBUTE, namespaceUri);
		final AxisIterator 	iterator 	= saxonNode.iterateAxis(AxisInfo.ATTRIBUTE, nodeTest);
		NodeInfo 			attribute 	= iterator.next();
		while (attribute != null) {
			list.add(attribute.getLocalPart());
			attribute = iterator.next();
		}
	}
	return list;
}
 
开发者ID:dita-semia,项目名称:dita-semia-resolver,代码行数:14,代码来源:SaxonNodeWrapper.java

示例6: getAttribute

@Override
public String getAttribute(String local_name) throws HttpClientException {
  // get the attribute
  NamePool pool = myNode.getConfiguration().getNamePool();
  NodeTest pred = new NameTest(Type.ATTRIBUTE, "", local_name, pool);
  AxisIterator attrs = myNode.iterateAxis(AxisInfo.ATTRIBUTE, pred);
  NodeInfo a = (NodeInfo) attrs.next();
  // return its string value, or null if there is no such attribute
  if (a == null) {
    return null;
  } else {
    return a.getStringValue();
  }
}
 
开发者ID:Armatiek,项目名称:xslweb,代码行数:14,代码来源:SaxonElement.java

示例7: getNameCode

/**
 * Get name code. The name code is a coded form of the node name: two nodes
 * with the same name code have the same namespace URI, the same local name,
 * and the same prefix. By masking the name code with &0xfffff, you get a
 * fingerprint: two nodes with the same fingerprint have the same local name
 * and namespace URI.
 *
 * @see net.sf.saxon.om.NamePool#allocate allocate
 */

public int getNameCode() {
	switch (nodeKind) {
	case Type.ELEMENT:
	case Type.ATTRIBUTE:
	case Type.PROCESSING_INSTRUCTION:
		return docWrapper.getNamePool().allocate(getPrefix(), getURI(),
				getLocalPart());
	default:
		return -1;
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:21,代码来源:NodeWrapper.java

示例8: getLocalPart

/**
 * Get the local part of the name of this node. This is the name after the
 * ":" if any.
 *
 * @return the local part of the name. For an unnamed node, returns "".
 */

public String getLocalPart() {
	switch (nodeKind) {
		case Type.ELEMENT:
			return ((Element) node).getLocalName();
		case Type.ATTRIBUTE:
			return ((Attribute) node).getLocalName();
		case Type.PROCESSING_INSTRUCTION:
			return ((ProcessingInstruction) node).getTarget();
		default:
			return "";
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:19,代码来源:NodeWrapper.java

示例9: getPrefix

/**
    * Get the prefix of the name of the node. This is defined only for elements and attributes.
    * If the node has no prefix, or for other kinds of node, return a zero-length string.
    * @return The prefix of the name of the node.
    */

public String getPrefix() {
	switch (nodeKind) {
		case Type.ELEMENT:
			return ((Element) node).getNamespacePrefix();
		case Type.ATTRIBUTE:
			return ((Attribute) node).getNamespacePrefix();
		default:
			return "";
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:16,代码来源:NodeWrapper.java

示例10: getURI

/**
 * Get the URI part of the name of this node. This is the URI corresponding
 * to the prefix, or the URI of the default namespace if appropriate.
 *
 * @return The URI of the namespace of this node. For an unnamed node, or
 *         for a node with an empty prefix, return an empty string.
 */

public String getURI() {
	switch (nodeKind) {
		case Type.ELEMENT:
			return ((Element) node).getNamespaceURI();
		case Type.ATTRIBUTE:
			return ((Attribute) node).getNamespaceURI();
		default:
			return "";
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:18,代码来源:NodeWrapper.java

示例11: getDisplayName

/**
 * Get the display name of this node. For elements and attributes this is
 * [prefix:]localname. For unnamed nodes, it is an empty string.
 *
 * @return The display name of this node. For a node with no name, return an
 *         empty string.
 */

public String getDisplayName() {
	switch (nodeKind) {
		case Type.ELEMENT:
			return ((Element) node).getQualifiedName();
		case Type.ATTRIBUTE:
			return ((Attribute) node).getQualifiedName();
		case Type.PROCESSING_INSTRUCTION:
			return ((ProcessingInstruction) node).getTarget();
		default:
			return "";
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:20,代码来源:NodeWrapper.java

示例12: getSchemaType

@Override
public SchemaType getSchemaType() {
	if (nodeKind == Type.ATTRIBUTE) {
		return AnySimpleType.getInstance();
	}
	return Untyped.getInstance();
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:7,代码来源:NodeWrapper.java

示例13: getNodeKind

/**
 * Returns type of the node.
 * @return node kind
 */
@Override
public int getNodeKind() {
    return Type.ATTRIBUTE;
}
 
开发者ID:rnveach,项目名称:checkstyle-backport-jre6,代码行数:8,代码来源:AttributeNode.java

示例14: buildSegments

private static LinkedList<ContentPathSegment<?, ?>> buildSegments(LinkedList<ContentPathSegment<?, ?>> segments, NodeInfo nodeInfo,
    @Nullable String nsPrefix, @Nullable String nsUri, String localName) {
    boolean attrNode = (nodeInfo.getNodeKind() == Type.ATTRIBUTE);

    if (attrNode) {
        segments.add(0, new AttributePathSegmentImpl(nsPrefix, nsUri, localName));
    }

    ElementPathSegment elemSegment = new ElementPathSegmentImpl(nsPrefix, nsUri, localName);
    segments.add(0, elemSegment);

    NodeInfo parentNodeInfo = nodeInfo.getParent();

    if ((parentNodeInfo != null) && (parentNodeInfo.getNodeKind() != Type.DOCUMENT)) {
        if (!attrNode) {
            int nodeIndex = -1;
            SameNameTest siblingNodeTest = new SameNameTest(nodeInfo);
            AxisIterator precedingSiblingNodeIterator = nodeInfo.iterateAxis(AxisInfo.PRECEDING_SIBLING, siblingNodeTest);

            while (precedingSiblingNodeIterator.next() != null) {
                nodeIndex++;
            }

            if (nodeIndex == -1) {
                if (nodeInfo.iterateAxis(AxisInfo.FOLLOWING_SIBLING, siblingNodeTest).next() != null) {
                    nodeIndex = 0;
                }
            } else {
                nodeIndex++;
            }

            if (nodeIndex >= 0) {
                elemSegment.setIndex(nodeIndex);
            }
        }

        buildSegments(segments, parentNodeInfo, parentNodeInfo.getPrefix(), parentNodeInfo.getURI(), parentNodeInfo.getLocalPart());
    }

    return segments;
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:41,代码来源:ContentPathBuilderImpl.java

示例15: getTypeAnnotation

/**
 * Get the type annotation of this node, if any. Returns -1 for kinds of
 * nodes that have no annotation, and for elements annotated as untyped, and
 * attributes annotated as untypedAtomic.
 *
 * @return the type annotation of the node.
 * @see net.sf.saxon.type.Type
 */

public int getTypeAnnotation() {
       if (getNodeKind() == Type.ATTRIBUTE) {
           return StandardNames.XS_UNTYPED_ATOMIC;
       }
       return StandardNames.XS_UNTYPED;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:15,代码来源:NodeWrapper.java


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