I tried to Compile a mss. as epub and received several incidents of an error message:
error on line x at column x PCDATA invalid Char data X.
Other error messages were similar except for character data #. I wrote the document in Scrivener with user-defined formatting. On the off-chance this was a problem due to a paste from another app, I tried Select All and reapplied formatting, but it didn’t correct the problem.
PS: I just copied two paragraphs from another word processor, pasted them directly into Scrivener, then pasted them again using Paste and Match Style. Compiled that one chapter and did not receive any error messages. So it doesn’t seem to be a Paste issue.
I’ve also pasted the text into other word processors and exported to epub with no problems.
This mss is 500+ pages 200K+ words., so these error messages are relatively infrequent. The text has been edited many times, you’d think the problem would occur more often.
If I get the error message in the future, is there a Find I can use to correct it?
These “errors” or “incompatibilities” are invisible to you in the editor. So, not really.
You’d have to use Sigil.
But, again, it’d be best to know the precise nature of the said error before speaking of maneuvers…
. . . . . .
Pasting from elsewhere won’t systematically generate an error…
It is to be avoided. Use Paste and match style always.
But (otherwise)… sometimes things go south, sometimes not.
Paste and match style strips the text of any foreign formatting. Should there be an issue in the making, and IF that’s where (foreign formatting) the issue is from, using that function guarantees there won’t be an issue.
It is kind of like wearing a helmet. You don’t just put it on when there is a rock falling.
Hi Vincent: Just did a Paste and Match Style on the two chapters before and after the error message and it solved the problem! Clearly there was something lurking in there out of sight. Lesson learned. Thanks for your help – wish I’d learned this before my deadline – it would have saved me from a very frustrating all-nighter. JHH
Find the exact location of the error in the project.
Look for invisible formatting commands (View → Text Editing → Show Invisibles).
Edit → Text Tidying → Zap Gremlins.
Paste and Match Style from the original source (if available).
If none of that helps, you’ll need to use Sigil or similar to look directly at the output file. (Even if looking at the HTML doesn’t help you, someone here may be able to interpret it.)
Thanks Kewms: I regularly Show Invisibles, and didn’t see anything. Did not know about Zap Gremlins – Gremlins, no less! What’s not to like?
I will use both commands in the future (Paste and Match, and Gremlins), to clean things up, and expect that will solve the problem.
Sigil? Not familiar with it. Looks like more firepower than I need since I don’t export epubs very often. But since it’s free, maybe worth having on hand?
Sigil install failed: Developer cannot be verified. I’m on OS 14.5 with an Apple MI Max. I downloaded the Apple ARM64 and got a file with extension txz.
Solved the error message problem, thanks to all your help, but now having a different, bigger problem with Compile.
The Scrivener epub file crashes Books, every single time. Calibre can’t open it. I tried with both Default Format and epub Format. Same problem. Not doing anything fancy here – just accepted the built in format, no adjustments.
Thinking something was wrong in my Project, I made a new Project, copied and pasted three files from the original Project, (I zapped Gremlins on them, tried with and without Paste and Match Style), and tried Compile – no problem with result.
epub is also fine if I copy a Scrivener file into Libre Office. Ditto into Mellel. (I don’t have Word).
So it doesn’t look like corrupt files – it seems to be something in my original Scrivener Project – probably did something weird with settings that I’d like to undo.
Sorry; don’t understand. Is what a valid Zip-file? When I compile a group of documents from within my Scrivener Project, the resulting file goes into Finder with the extension epub, or pdf, or whatever. I’m not dealing with any zip files.