Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-21-2009, 08:16 AM   #1
Rogier
Member
Rogier began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2009
Device: Sony PRS-505 & Iliad Bookworm
Converting XSL + XML into Epub, is there an easy way?

-----------I also posted this thread at the Epub section----------------

Hello guys,

I have a small question about converting books into Epub.

At the moment I have some books in XML + XSL and I would like to convert them into Epub. It's possible, because now im converting XML + XSL into Mobipocket with the Mobipocket Creator, after that I am using Calibre to convert Mobipocket into Epub. But I have like 250 books to go.

Is there a faster way to convert XML files into Epub?

2nd question: At the moment my XML books are in 1 XML file so each book has his own XML file. How do I easily "chop" them in seperated chapters?



Greetings,

Rogier.
Rogier is offline   Reply With Quote
Old 04-21-2009, 08:23 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can convert the HTML generated from the XML+XSL directly into EPUB using calibre. And calibre will split the epub into parts for you automatically, using the chapter detection option.
kovidgoyal is offline   Reply With Quote
Old 04-21-2009, 08:55 AM   #3
Rogier
Member
Rogier began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2009
Device: Sony PRS-505 & Iliad Bookworm
Could you advise me, how to convert XML+XSL into HTML?
Rogier is offline   Reply With Quote
Old 04-21-2009, 02:30 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You basically need a tool that will apply the XSL stylesheet to the XML file. The one I use is called xsltproc, but that is a linux tool.
kovidgoyal is offline   Reply With Quote
Old 09-18-2012, 03:45 PM   #5
bitemeok
Connoisseur
bitemeok began at the beginning.
 
Posts: 55
Karma: 42
Join Date: Aug 2010
Location: Silver Spring, MD
Device: Sony PRS-300
I've been trying to use calibre to convert an xml file that I had converted to htm & I keep getting an error message that the conversion failed.


Convert book 1 of 1 (Reflections)
Processing archive...
Resolved conversion options
calibre version: 0.8.61
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 10.0,
'book_producer': None,
'breadth_first': False,
'change_justification': u'original',
'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., 'chapter|book|section|part\\s+', 'i')) or @class = 'chapter']",
'chapter_mark': u'pagebreak',
'comments': None,
'cover': u'C:\\Users\\----removed----\\AppData\\Local\\Temp\\calibre_0.8.61_tmp_ewabll\ \ob7zoo.jpeg',
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'dont_package': False,
'dont_split_on_page_breaks': False,
'duplicate_links_in_toc': False,
'enable_heuristics': False,
'epub_flatten': False,
'extra_css': None,
'extract_to': None,
'filter_css': u'',
'fix_indents': True,
'flow_size': 260,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'input_encoding': None,
'input_profile': <calibre.customize.profiles.InputProfile object at 0x05326870>,
'insert_blank_line': False,
'insert_blank_line_size': 0.5,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0.0,
'linearize_tables': False,
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markup_chapter_headings': True,
'max_levels': 5,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'no_chapters_in_toc': False,
'no_default_epub_cover': False,
'no_inline_navbars': False,
'no_svg_cover': False,
'output_profile': <calibre.customize.profiles.SonyReader300Output object at 0x05326D30>,
'page_breaks_before': u"//*[name()='h1' or name()='h2']",
'prefer_metadata_cover': False,
'preserve_cover_aspect_ratio': False,
'pretty_print': True,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': u'C:\\Users\\----removed---\\AppData\\Local\\Temp\\calibre_0.8.61_tmp_ewabll\ \tflplr.opf',
'remove_fake_margins': True,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': u'',
'search_replace': '[]',
'series': None,
'series_index': None,
'smarten_punctuation': False,
'sr1_replace': None,
'sr1_search': None,
'sr2_replace': None,
'sr2_search': None,
'sr3_replace': None,
'sr3_search': None,
'tags': None,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'unsmarten_punctuation': False,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
InputFormatPlugin: HTML Input running
on C:\Users\----removed----\AppData\Local\Temp\calibre_0.8.61_tmp_ewabll\ypkn aq_plumber_archive\content.opf
Parsing all content...
Manifest item 'toc.ncx' not found
Parsing Reflections.htm ...
Found microsoft markup, cleaning...
Referenced file 'Reflections_files/filelist.xml' not found
Generating default TOC from spine...
Merging user specified metadata...
Detecting structure...
Auto generated TOC with 0 entries.
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 459 items of level: p_10
Found 58 items of level: p_11
Found 1 items of level: div_1
Found 995 items of level: p_8
Found 1274 items of level: p_9
Found 19 items of level: p_6
Found 134 items of level: p_7
Found 4 items of level: p_4
Found 14 items of level: p_5
Found 2 items of level: p_3
Ignoring level p_6
Ignoring level p_4
Ignoring level p_5
Ignoring level p_3
p_10 left margin stats: Counter({u'': 459})
p_10 right margin stats: Counter({u'': 459})
p_11 left margin stats: Counter({u'': 58})
p_11 right margin stats: Counter({u'': 58})
div_1 left margin stats: Counter({u'': 1})
div_1 right margin stats: Counter({u'': 1})
p_8 left margin stats: Counter({u'': 995})
p_8 right margin stats: Counter({u'': 995})
p_9 left margin stats: Counter({u'': 1274})
p_9 right margin stats: Counter({u'': 1274})
p_7 left margin stats: Counter({u'': 134})
p_7 right margin stats: Counter({u'': 134})
Cleaning up manifest...
Trimming unused files from manifest...
Creating EPUB Output...
Splitting markup on page breaks and flow limits, if any...
Looking for large trees in Reflections.htm...
Found large tree #0
Splitting...
Split point: {http://www.daisy.org/z3986/2005/dtbook/}h3 /*/*[2]/*/ns1:dtbook/ns1:book/ns1:bodymatter/ns1:level1[5]/ns1:level2[4]/ns1:level3[3]/ns1:h3
Python function terminated unexpectedly
Undefined namespace prefix (Error Code: 1)
Traceback (most recent call last):
File "site.py", line 132, in main
File "site.py", line 109, in run_entry_point
File "site-packages\calibre\utils\ipc\worker.py", line 192, in main
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 31, in gui_convert_override
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert
File "site-packages\calibre\ebooks\conversion\plumber.py", line 1116, in run
File "site-packages\calibre\ebooks\conversion\plugins\epub_ou tput.py", line 169, in convert
File "site-packages\calibre\ebooks\oeb\transforms\split.py", line 58, in __call__
File "site-packages\calibre\ebooks\oeb\transforms\split.py", line 68, in split_item
File "site-packages\calibre\ebooks\oeb\transforms\split.py", line 211, in __init__
File "site-packages\calibre\ebooks\oeb\transforms\split.py", line 411, in split_to_size
File "site-packages\calibre\ebooks\oeb\transforms\split.py", line 310, in do_split
File "site-packages\calibre\ebooks\oeb\transforms\split.py", line 274, in adjust_split_point
File "lxml.etree.pyx", line 1459, in lxml.etree._Element.xpath (src/lxml/lxml.etree.c:40530)
File "xpath.pxi", line 324, in lxml.etree.XPathElementEvaluator.__call__ (src/lxml/lxml.etree.c:113864)
File "xpath.pxi", line 242, in lxml.etree._XPathEvaluatorBase._handle_result (src/lxml/lxml.etree.c:113063)
File "xpath.pxi", line 227, in lxml.etree._XPathEvaluatorBase._raise_eval_error (src/lxml/lxml.etree.c:112894)
lxml.etree.XPathEvalError: Undefined namespace prefix

Can someone tell me what I'm doing wrong, or is the problem with the original file?
bitemeok is offline   Reply With Quote
Old 09-18-2012, 11:20 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You have incorrect namespaces in the file you are feeding to calibre. html tags have to either be with no namespace or in the xhtml namespace, yours appear to be in the dtbook namespace.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy Instructions for Converting a File to Kindle? crutnacker Amazon Kindle 5 01-02-2010 07:48 AM
Converting XML + XSL to Epub. Is there an easy way to do it? Rogier ePub 4 04-22-2009 10:26 AM
Young Adult Marryat, Frederick: Midshipman Easy ePUB v 1 1 jan 2009 mtravellerh ePub Books 0 01-01-2009 01:35 PM
How easy is converting ebooks? madmandegge Netronix 5 09-23-2008 02:08 AM
DocBook XSL 1.74.0 adds ePub support! Alexander Turcic News 1 06-14-2008 07:06 AM


All times are GMT -4. The time now is 04:48 AM.


MobileRead.com is a privately owned, operated and funded community.