private String findAtomLink ( final Element parent , final String rel ) { String ret = null ; final List < Element > linksList = parent . getChildren ( "link" , ATOM_10_NS ) ; if ( linksList != null ) { for ( final Element element : linksList ) { final Element link = element ; final Attribute relAtt = getAttribute ( link , "rel" ) ; final Attribute hrefAtt = getAttribute ( link , "href" ) ; if ( relAtt == null && "alternate" . equals ( rel ) || relAtt != null && relAtt . getValue ( ) . equals ( rel ) ) { ret = hrefAtt . getValue ( ) ; break ; } } } return ret ; }
Return URL string of Atom link element under parent element . Link with no rel attribute is considered to be rel = alternate