View Full Version : Itunes producer invalid file name error


patrickyoung
02-12-2012, 05:47 AM
I've created an epub file using Sigil and it checked ok with no errors.

But when I try to transfer it to iTunes using producer, I get this message:

ERROR ITMS-3000: "Line 98 column 54: character content of element "file_name" invalid; must be a string matching the regular expression "[^./: ]+([.][^./: ]+)+" at XPath /package/book/assets/asset[2]/data_file/file_name"

Any idea how I can identify the invalid file name? Can I do this with Sigil? And if so, how do I go about correcting the error?

Toxaris
02-12-2012, 07:14 AM
I think you have a filename with special characters in it. It is best to avoid all kind of special character, including a space.
Rename the files you need in Sigil. Don't forget to regenerate the TOC if required.

patrickyoung
02-12-2012, 01:30 PM
I think you have a filename with special characters in it. It is best to avoid all kind of special character, including a space.
Rename the files you need in Sigil. Don't forget to regenerate the TOC if required.



I've gone through the 500 page document looking for special characters and can't see any. Does the error message give any clue as to where I should be looking?

"Line 98 column 54: character content of element "file_name" invalid; must be a string matching the regular expression "[^./: ]+([.][^./: ]+)+" at XPath /package/book/assets/asset[2]/data_file/file_name"


I've opened the document in Sigil code view and line 98 doesn't have any text (its a blank line)

Toxaris
02-12-2012, 02:29 PM
You must look at the filenames of the documents in the archive, not the document itself. The linenumber is totally irrelevant, since the iTunes program fails to mention the document the linenumber relates to. After all, an ePUB is a collection of documents.

patrickyoung
02-12-2012, 03:17 PM
When you say look in the archive, do you mean open up sigil and check the files there? I only have three images in the image folder: COVER.jpg, mithra-ad2.jpg and
your-message-ad.jpg

Is there anything there that looks like a special character or am I looking in the wrong place?

ghostyjack
02-12-2012, 03:35 PM
I assume this epub file has more than just images in it.

Look at the file names of all the files within the epub, not just the images.

If you've got it open in Sigil then look at all the files in all the folders the book browser, one of them may be the error.

BTW, I don't seem much wrong with the image files, must be the others.

patrickyoung
02-12-2012, 05:28 PM
This is the content opf file. Is there anything in it that looks like it could be an error?

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookId" version="2.0">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:identifier id="BookId" opf:scheme="UUID">urn:uuid:b8b0b36f-4be3-44d4-85a8-62e16129187a</dc:identifier>
<dc:title>Under the cover of darkness</dc:title>
<dc:creator opf:role="aut">Duane De Mello</dc:creator>
<dc:language>en</dc:language>
<meta content="0.4.2" name="Sigil version" />
<meta name="cover" content="COVER.jpg" />
</metadata>
<manifest>
<item href="toc.ncx" id="ncx" media-type="application/x-dtbncx+xml" />
<item href="Text/Section0001.xhtml" id="Section0001.xhtml" media-type="application/xhtml+xml" />
<item href="Images/mithra-ad2.jpg" id="mithra-ad2.jpg" media-type="image/jpeg" />
<item href="Images/your-message-ad.jpg" id="your-message-ad.jpg" media-type="image/jpeg" />
<item href="Images/COVER.jpg" id="COVER.jpg" media-type="image/jpeg" />
</manifest>
<spine toc="ncx">
<itemref idref="Section0001.xhtml" />
</spine>
</package>

DaleDe
02-12-2012, 10:12 PM
It may be that it does not like hyphens in a name. Try changing them to _ (underscore)

patrickyoung
02-13-2012, 03:26 AM
Thanks for the suggestion Dale. I have changed the files names so that the content opf now looks like this:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookId" version="2.0">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:identifier id="BookId" opf:scheme="UUID">urn:uuid:b8b0b36f-4be3-44d4-85a8-62e16129187a</dc:identifier>
<dc:title>Under the cover of darkness</dc:title>
<dc:creator opf:role="aut">Duane De Mello</dc:creator>
<dc:language>en</dc:language>
<meta content="0.4.2" name="Sigil version" />
<meta content="COVER.jpg" name="cover" />
</metadata>
<manifest>
<item href="toc.ncx" id="ncx" media-type="application/x-dtbncx+xml" />
<item href="Text/Section0001.xhtml" id="Section0001.xhtml" media-type="application/xhtml+xml" />
<item href="Images/mithra.jpg" id="mithra.jpg" media-type="image/jpeg" />
<item href="Images/message.jpg" id="message.jpg" media-type="image/jpeg" />
<item href="Images/COVER.jpg" id="COVER.jpg" media-type="image/jpeg" />
</manifest>
<spine toc="ncx">
<itemref idref="Section0001.xhtml" />
</spine>
</package>


But I'm still getting this error message:




ERROR ITMS-3000: "Line 98 column 54: character content of element "file_name" invalid; must be a string matching the regular expression "[^./: ]+([.][^./: ]+)+" at XPath /package/book/assets/asset[2]/data_file/file_name"

Is it likely the error is somewhere else?

Toxaris
02-13-2012, 05:25 AM
I assume you not only changed you opf but also the actual filenames?

It would help if iTunes would mentiontion in which file the line 98 is they complain about. Is there something in the xhtml file? A link or something?

patrickyoung
02-13-2012, 05:56 AM
yes changed the file names and in the opf file. I sent the book to my ipad to test it and it looked fine. I've tried to click on the xhtml file (when in book browser) but it doesn't open up.

Toxaris
02-13-2012, 08:38 AM
That is strange, in Sigil you must be able to open the xhtml. It is your book after all. However, is the book in 1 xhtml file? Normally a split for each chapter is used. That is easier for the layout, maintenance and some readers have a limit of the size of the xhtml size.

patrickyoung
02-13-2012, 09:52 AM
Only have 1 xhtml file. Its called Section0001.xhtml. When you click it, it shows you the book as you would see it in bookview.

Toxaris
02-13-2012, 01:53 PM
Is there a link or reference somewhere within the Section0001.xhtml, perhaps in the codeview?

patrickyoung
02-13-2012, 03:58 PM
In code view, here's what it says before you get to the actual novel


<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
/*<![CDATA[*/

p.sgc-1 {font-style: italic; text-align: center}

p.sgc-2 {font-style: italic}
/*]]>*/
</style>
</head>

<body>
<p><br /></p>

<p><br /></p>

<p><br /></p>

<p><br /></p>

<p><br /></p>

<p>Under the Cover of Darkness</p>

<p><br /></p>

<p>by</p>

<p><br /></p>

<p>Duane De Mello &nbsp;</p>

<p><br /></p>

<p><br /></p>

<p><br /></p>

<p><br /></p>

<p><!--StartFragment--></p>

patrickyoung
02-13-2012, 04:02 PM
Just looking back at my posts and wonder if this line

metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlnspf="http://www.idpf.org/2007/opf">

could have an effect? If you look at it in the original posting, it has a smiley character

Jellby
02-13-2012, 04:27 PM
That's only because the forum replaces :o with :o (you can prevent it either checking the "disable smilies in text" option or using the [noparse] tag)

patrickyoung
02-13-2012, 04:34 PM
so its not likely to be the characters causing the problem?

Toxaris
02-14-2012, 03:33 AM
No. The snippet you posted is fine. The problem must be elsewhere.Could you post the epub, perhaps in a censored way so we can check?

patrickyoung
02-14-2012, 05:43 AM
I'm afraid as we're contracted to publish the manuscript, we can't send it to anyone. FYI I even went back to the original manuscript, copy and pasted it into notepad and then into word. This was just in case there was some sort of hidden code in the word document. But, nothing. Ran it through iTunes again and got the same error message. If anyone can help us fix this problem, we'll give them a mention in the book (next to the publishing company) and link back to their site.

Toxaris
02-14-2012, 02:13 PM
Without more information I can't really help, sorry.

DaleDe
02-14-2012, 02:21 PM
I see there is a free extract from the book available on various web sites. If you make an ePub from the extract does it have the same problem? If so perhaps you could post it with appropriate disclaimers and promotion.

Dale