From 072b4834fc3ce822f87a99928a89efc1b7637986 Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Fri, 4 Dec 2009 09:50:57 +0000
Subject: [PATCH] Fix xpath expression

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31068 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5OOo/FormPrintout.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/product/ERP5OOo/FormPrintout.py b/product/ERP5OOo/FormPrintout.py
index f1cf5b36b6..e19a04ed3f 100644
--- a/product/ERP5OOo/FormPrintout.py
+++ b/product/ERP5OOo/FormPrintout.py
@@ -933,7 +933,7 @@ class ODTStrategy(ODFStrategy):
       return element_tree
     parent_node_xpath = '//text:reference-mark-start[@text:name="%s"]/parent::*[1]' % field_id
     parent_node = element_tree.xpath(parent_node_xpath, namespaces=element_tree.nsmap)[0]
-    text_reference_position = int(parent_node.xpath('count(preceding-sibling::text:reference-mark-start)', namespaces=element_tree.nsmap))
+    text_reference_position = int(parent_node.xpath('count(text:reference-mark-start/preceding-sibling::*)', namespaces=element_tree.nsmap))
 
     #Delete all contents between <text:reference-mark-start/> and <text:reference-mark-end/>
     #Try to fetch style-name
-- 
2.30.9