Node getLocalName - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Node getLocalName method.

This code example shows how to use the following methods:getLocalName
	} 
 
	@Override 
	public String getText(Object element) {
		Node node = (Node) element;
		return node.getLocalName();
	} 
} 
7
CodeRank
This code example shows how to use the following methods:getLocalName, getOwnerDocument
	 * {@inheritDoc} 
	 */ 
	@Override 
	protected IType calculateType(String name, String target, Node node, Node parentNode,
			IDocument document) {
		if (node != null && "registration-listener".equals(node.getLocalName())) {
			String ref = BeansEditorUtils.getAttribute(node, "ref");
			if (ref != null) {
				IFile file = BeansEditorUtils.getFile(document);
				String className = BeansEditorUtils.getClassNameForBean(file, node
						.getOwnerDocument(), ref);
				if (file != null && file.exists()) {
					return JdtUtils.getJavaType(file.getProject(), className);
				} 
			} 
		} 
		return null; 
	} 
 
} 
7
CodeRank
This code example shows how to use the following methods:getLocalName
	} 
 
	@Override 
	public String getText(Object o) {
		Node node = (Node) o;
		String shortNodeName = node.getLocalName();
 
		String text = shortNodeName;
		if ("groovy".equals(shortNodeName) || "bsh".equals(shortNodeName)
				|| "jruby".equals(shortNodeName)) {
			String id = BeansEditorUtils.getAttribute(node, "id");
			if (StringUtils.hasText(id)) {
				text += " " + id;
			} 
			if (BeansContentOutlineConfiguration.isShowAttributes()) { 
				String ss = BeansEditorUtils
						.getAttribute(node, "script-source");
				if (StringUtils.hasText(ss)) {
					text += " [" + ss + "]";
				} 
			} 
7
CodeRank
This code example shows how to use the following methods:appendChild, getLocalName, getNodeType, getOwnerDocument
    protected TransformService spi;
 
    /** 
     * Creates a <code>DOMTransform</code>. 
     * 
     * @param spi the TransformService 
     */ 
    public DOMTransform(TransformService spi) {
        this.spi = spi;
    } 
 
    /** 
     * Creates a <code>DOMTransform</code> from an element. This constructor 
     * invokes the abstract {@link #unmarshalParams unmarshalParams} method to 
     * unmarshal any algorithm-specific input parameters. 
     * 
     * @param transElem a Transform element 
     */ 
    public DOMTransform(Element transElem, XMLCryptoContext context,
        Provider provider) throws MarshalException {

7
CodeRank
This code example shows how to use the following methods:getLocalName, getPrefix
        String lname;
        doc = (Document) load("staffNS", builder);
        newList = doc.getElementsByTagNameNS("*", "employee");
        assertEquals("employeeCount", 5, newList.getLength());
        newElement = (Element) newList.item(3);
        prefix = newElement.getPrefix();
        assertEquals("prefix", "emp", prefix);
        lname = newElement.getLocalName();
        assertEquals("lname", "employee", lname);
    } 
    public void testGetElementsByTagNameNS3() throws Throwable { 
        Document doc;
        NodeList elementList;
        Node child;
        String childName;
        List<String> result = new ArrayList<String>();
 
        List<String> expectedResult = new ArrayList<String>();
        expectedResult.add("employee");
        expectedResult.add("employeeId");
7
CodeRank
This code example shows how to use the following methods:getLocalName, getNodeType, getParentNode
		return Tag.UNKNOWN;
	} 
 
	public static Tag getTag(Node node) {
		if (node != null) {
			if (node.getNodeType() == Node.TEXT_NODE) {
				return getTag(node.getParentNode());
			} else if (node.getNodeType() == Node.ELEMENT_NODE
					|| node.getNodeType() == Node.COMMENT_NODE) {
				return getTag(node.getLocalName());
			} 
		} 
		return Tag.UNKNOWN;
	} 
 
	public static boolean isTag(Node node, Tag tag) {
		return (getTag(node) == tag);
	} 
 
	public static List<Node> getChildElementsByTagName(Element element,
7
CodeRank
This code example shows how to use the following methods:getLocalName, getNamespaceURI
		return null; 
	} 
 
	@Override 
	public boolean isLinkableAttr(Attr attr, Node annotation) {
		if (ToolAnnotationUtils.ANNOTATION_ELEMENT.equals(annotation.getLocalName())
				&& ToolAnnotationUtils.TOOL_NAMESPACE_URI.equals(annotation.getNamespaceURI())) {
			ToolAnnotationData annotationData = ToolAnnotationUtils.getToolAnnotationData(annotation);
			return annotationData != null
					&& (REF_ATTRIBUTE.equals(annotationData.getKind())
							|| Class.class.getName().equals(annotationData.getExpectedType())
							|| annotationData.getExpectedMethodRef() != null || annotationData.getExpectedMethodType() != null);
		} 
		return false; 
	} 
 
	protected String evaluateXPathExpression(String xpath, Node node) {
		XPathFactory factory = XPathFactory.newInstance();
		XPath path = factory.newXPath();
		try { 
7
CodeRank
This code example shows how to use the following methods:getLocalName
 
	@Override 
	public String getText(Object element) {
		if (element instanceof Node) {
			Node node = (Node) element;
			return node.getLocalName();
		} 
		return super.getText(element);
	} 
	 
} 
7
CodeRank
This code example shows how to use the following methods:getLocalName, getNamespaceURI
this.namespaceDecl = buf.toString();
    } 
     
    private void outputQualifiedName(Node n, StringBuffer buf) {
        String nsURI = n.getNamespaceURI();
        if (nsURI == null || nsURI.length() == 0) {
            buf.append(n.getNodeName());
        } else { 
            String prefix = (String) namespacesToPrefixLookup.get(nsURI);
            if (prefix == null) {
                //REVISIT! 
                buf.append(n.getNodeName());
            } else { 
                if (prefix.length() > 0) {
                    buf.append(prefix);
                    buf.append(':');
                } 
                buf.append(n.getLocalName());
            } 

8
CodeRank
This code example shows how to use the following methods:getLocalName
	} 
 
	@Override 
	public String getText(Object o) {
		Node node = (Node) o;
		return node.getLocalName();
	} 
} 
7
CodeRank
getLocalName Method Overview
Returns the local part of the qualified name of this node.
See Code Examples for other Java 8 Node Methods: