本文整理汇总了Java中mf.org.w3c.dom.Node.getLocalName方法的典型用法代码示例。如果您正苦于以下问题:Java Node.getLocalName方法的具体用法?Java Node.getLocalName怎么用?Java Node.getLocalName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mf.org.w3c.dom.Node
的用法示例。
在下文中一共展示了Node.getLocalName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateQName
import mf.org.w3c.dom.Node; //导入方法依赖的package包/类
protected final void updateQName (Node node, QName qname){
String prefix = node.getPrefix();
String namespace = node.getNamespaceURI();
String localName = node.getLocalName();
// REVISIT: the symbols are added too often: start/endElement
// and in the namespaceFixup. Should reduce number of calls to symbol table.
qname.prefix = (prefix!=null && prefix.length()!=0)?fSymbolTable.addSymbol(prefix):null;
qname.localpart = (localName != null)?fSymbolTable.addSymbol(localName):null;
qname.rawname = fSymbolTable.addSymbol(node.getNodeName());
qname.uri = (namespace != null)?fSymbolTable.addSymbol(namespace):null;
}
示例2: getLocalName
import mf.org.w3c.dom.Node; //导入方法依赖的package包/类
public String getLocalName(int index) {
if (fAttributes != null) {
Node node = (Node) fAttributes.getItem(index);
String localName = node.getLocalName();
localName = (localName != null) ? fSymbolTable.addSymbol(localName) : null;
return localName;
}
return null;
}
示例3: fillQName
import mf.org.w3c.dom.Node; //导入方法依赖的package包/类
private void fillQName(QName toFill, Node node) {
final String prefix = node.getPrefix();
final String localName = node.getLocalName();
final String rawName = node.getNodeName();
final String namespace = node.getNamespaceURI();
toFill.prefix = (prefix != null) ? fSymbolTable.addSymbol(prefix) : XMLSymbols.EMPTY_STRING;
toFill.localpart = (localName != null) ? fSymbolTable.addSymbol(localName) : XMLSymbols.EMPTY_STRING;
toFill.rawname = (rawName != null) ? fSymbolTable.addSymbol(rawName) : XMLSymbols.EMPTY_STRING;
toFill.uri = (namespace != null && namespace.length() > 0) ? fSymbolTable.addSymbol(namespace) : null;
}
示例4: remove
import mf.org.w3c.dom.Node; //导入方法依赖的package包/类
private final Node remove(AttrImpl attr, int index,
boolean addDefault) {
CoreDocumentImpl ownerDocument = ownerNode.ownerDocument();
String name = attr.getNodeName();
if (attr.isIdAttribute()) {
ownerDocument.removeIdentifier(attr.getValue());
}
if (hasDefaults() && addDefault) {
// If there's a default, add it instead
NamedNodeMapImpl defaults =
((ElementImpl) ownerNode).getDefaultAttributes();
Node d;
if (defaults != null &&
(d = defaults.getNamedItem(name)) != null &&
findNamePoint(name, index+1) < 0) {
NodeImpl clone = (NodeImpl)d.cloneNode(true);
if (d.getLocalName() !=null){
// we must rely on the name to find a default attribute
// ("test:attr"), but while copying it from the DOCTYPE
// we should not loose namespace URI that was assigned
// to the attribute in the instance document.
((AttrNSImpl)clone).namespaceURI = attr.getNamespaceURI();
}
clone.ownerNode = ownerNode;
clone.isOwned(true);
clone.isSpecified(false);
nodes.set(index, clone);
if (attr.isIdAttribute()) {
ownerDocument.putIdentifier(clone.getNodeValue(),
(ElementImpl)ownerNode);
}
} else {
nodes.remove(index);
}
} else {
nodes.remove(index);
}
// changed(true);
// remove reference to owner
attr.ownerNode = ownerDocument;
attr.isOwned(false);
// make sure it won't be mistaken with defaults in case it's
// reused
attr.isSpecified(true);
attr.isIdAttribute(false);
// notify document
ownerDocument.removedAttrNode(attr, ownerNode, name);
return attr;
}
示例5: getLocalName
import mf.org.w3c.dom.Node; //导入方法依赖的package包/类
/** returns local name of this element if not null, otherwise
returns the name of the node
*/
public static String getLocalName(Node node) {
String name = node.getLocalName();
return (name!=null)? name:node.getNodeName();
}