From 53513fe6de3120567b89c5cb7b1e693176edeacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 27 May 2014 20:55:53 +0200 Subject: [PATCH] fix handling of level 4 sections (#4854) --- legi2odf/legi2odf.xsl | 4 +++- odf2legi/odf2legi.py | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/legi2odf/legi2odf.xsl b/legi2odf/legi2odf.xsl index 3b6789a..f4c71d4 100644 --- a/legi2odf/legi2odf.xsl +++ b/legi2odf/legi2odf.xsl @@ -28,7 +28,7 @@ - + @@ -143,6 +143,7 @@ Heading_20_3 Heading_20_4 Heading_20_5 + Heading_20_6 Unknown location for title: @@ -154,6 +155,7 @@ 3 4 5 + 6 diff --git a/odf2legi/odf2legi.py b/odf2legi/odf2legi.py index 21b5ac1..128e6f7 100644 --- a/odf2legi/odf2legi.py +++ b/odf2legi/odf2legi.py @@ -60,6 +60,9 @@ TITLE_LEVELS = { 'Sec 1.1.1': 'sect3', 'Sec_20_1.1.1': 'sect3', 'Heading_20_5': 'sect3', + 'Sec 1.1.1.1': 'sect4', + 'Sec_20_1.1.1.1': 'sect4', + 'Heading_20_6': 'sect4', 'Lchapitre': 'legistic_chapter', 'Lsection': 'legistic_section', 'LSous-Section': 'legistic_subsection', @@ -899,7 +902,8 @@ def convert_to_legi_xml(content, metadata = None): speech = None offstructure = None - levels = {'book':0, 'part':1, 'chapter':2, 'preface':2, 'synthese':2, 'sect1':3, 'sect2':4, 'sect3':5} + levels = {'book':0, 'part':1, 'chapter':2, 'preface':2, 'synthese':2, + 'sect1':3, 'sect2':4, 'sect3':5, 'sect4':6} legistic_levels = {'legistic_part': 0, 'legistic_book': 1, 'legistic_title': 2,