Return a single value text attribute for a given xpath or None.
(self, xpath, xml=None)
| 737 | return ParentPom('%s:%s:pom:%s' % (group_id, artifact_id, version)) |
| 738 | |
| 739 | def _get_attribute(self, xpath, xml=None): |
| 740 | """Return a single value text attribute for a given xpath or None.""" |
| 741 | if xml is None: |
| 742 | xml = self.pom_data |
| 743 | attr = xml.findtext(xpath) |
| 744 | val = attr and attr.strip() or None |
| 745 | if TRACE: |
| 746 | if 'artifactId' in xpath: |
| 747 | logger.debug('MavenPom._get_attribute: xpath: {}'.format(xpath)) |
| 748 | logger.debug('MavenPom._get_attribute: xml: {}'.format(xml)) |
| 749 | return val |
| 750 | |
| 751 | def _get_attributes_list(self, xpath, xml=None): |
| 752 | """Return a list of text attributes for a given xpath or empty list.""" |
no test coverage detected