Here you can find the source of getAttribute(Node node, String name)
Parameter | Description |
---|---|
node | the node from which to get the attribute node |
name | the attribute name for which to get the node |
public final static Node getAttribute(Node node, String name) throws DOMException
//package com.java2s; /**//from w w w. ja va 2s .c om * Copyright (c) 1999-2007, Fiorano Software Technologies Pvt. Ltd. and affiliates. * Copyright (c) 2008-2015, Fiorano Software Pte. Ltd. and affiliates. * * All rights reserved. * * This software is the confidential and proprietary information * of Fiorano Software ("Confidential Information"). You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * enclosed with this product or entered into with Fiorano. */ import org.w3c.dom.*; public class Main { /** * Gets the attribute of the node. * *@param node the node from which to get the attribute node *@param name the attribute name for which to get the node *@return The attribute node *@exception DOMException if an error occurs while getting the attribute * node */ public final static Node getAttribute(Node node, String name) throws DOMException { if (node != null && node.hasAttributes()) { NamedNodeMap attrs = node.getAttributes(); return attrs.getNamedItem(name); } return null; } }