Here you can find the source of getAttribute(NamedNodeMap ruleAttributes, String attributeName)
Parameter | Description |
---|---|
ruleAttributes | a node map of attributes |
attributeName | the name of the attribute to retrieve |
public static String getAttribute(NamedNodeMap ruleAttributes, String attributeName)
//package com.java2s; /*//from www .ja va 2s. c om MiringValidator Semantic Validator for MIRING compliant HML Copyright (c) 2015 National Marrow Donor Program (NMDP) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. > http://www.gnu.org/licenses/lgpl.html */ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { /** * Get an attribute by name * * @param ruleAttributes a node map of attributes * @param attributeName the name of the attribute to retrieve * @return the value of the attribute. */ public static String getAttribute(NamedNodeMap ruleAttributes, String attributeName) { Node miringRuleNode = ruleAttributes.getNamedItem(attributeName); String miringRule = miringRuleNode != null ? miringRuleNode.getNodeValue() : null; return miringRule; } }