summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xitstool.in22
1 files changed, 13 insertions, 9 deletions
diff --git a/itstool.in b/itstool.in
index 54117a5..2401918 100755
--- a/itstool.in
+++ b/itstool.in
@@ -390,15 +390,19 @@ class Document (object):
except:
oldnode = None
xpath.setContextNode(node)
- for note in self._try_xpath_eval(xpath, sel):
- if self.get_preserve_space(note):
- cont = note.content
- else:
- cont = re.sub('\s+', ' ', note.content).strip()
- if ref:
- cont = 'SEE: ' + cont
- self._its_loc_notes[node] = cont
- break
+ note = self._try_xpath_eval(xpath, sel)
+ if isinstance(note, basestring):
+ self._its_loc_notes[node] = note
+ else:
+ for note in note:
+ if self.get_preserve_space(note):
+ cont = note.content
+ else:
+ cont = re.sub('\s+', ' ', note.content).strip()
+ if ref:
+ cont = 'SEE: ' + cont
+ self._its_loc_notes[node] = cont
+ break
xpath.setContextNode(oldnode)
elif xml_is_ns_name(rule, NS_ITS, 'langRule'):
if rule.prop('selector') is not None and rule.prop('langPointer') is not None: