Here you can find the source of getAttributeNode(Node sNode, String attribName)
Parameter | Description |
---|---|
n | a parameter |
public static Node getAttributeNode(Node sNode, String attribName)
//package com.java2s; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { /**/*from w w w .j a va 2 s . co m*/ * Decide if the node is text, and so must be handled specially * * @param n * @return */ public static Node getAttributeNode(Node sNode, String attribName) { NamedNodeMap attrs = sNode.getAttributes(); if (attrs != null) { return attrs.getNamedItem(attribName); } return null; } }