Code example for Element

Methods: getAttributeNShasAttributeNS

0
    /** 
     * @see org.xbrlapi.Link#getLinkRole() 
     */ 
    public URI getLinkRole() throws XBRLException {
    	Element root = getDataRootElement();
    	if (root.hasAttributeNS(Constants.XLinkNamespace.toString(),"role")) {
    	    String role = root.getAttributeNS(Constants.XLinkNamespace.toString(),"role");
    	    try { 
    	        return new URI(role);
    	    } catch (URISyntaxException e) {
    	        throw new XBRLException("The link role, " + role + ", is not a valid URI.",e);
    	    } 
    	} 
    	return null; 
    } 
     
}