View Full Version : Help, I can't figure out this epub validation error


bfollowell
05-10-2011, 09:48 AM
I've gotten used to using the Validate Epub option in Sigil. I believe it uses the Flightcrew validator. Occasionally I'll find an error and am able to fix it fairly easily. More often I'm thrilled to see No Errors Found displayed.

I've run an error now and I cannot figure it out for the life of me.

I have an image that appears under the chapter number on every chapter header.

This is the error I'm receiving:

value 'id=' does not match regular expression facet '\c+'

and this is the code for every one of these instances:

<p class="tightgraphic2"><img alt="" height="79" src="../Images/EmpireEmblem.jpg" width="30" /></p>

I have no idea what may be wrong with this code that could be causing this error. Does anyone see a problem with it that I may be missing?

Thanks.

- Byron Followell

EowynCarter
05-10-2011, 10:50 AM
it looks like it expects an "id" attribute on either the paragraph or images.

Someting like :
<p id="image_p" class="tightgraphic2"><img alt="" id="myimage" height="79" src="../Images/EmpireEmblem.jpg" width="30" /></p>

bfollowell
05-10-2011, 10:58 AM
it looks like it expects an "id" attribute on either the paragraph or images.

Someting like :
<p id="image_p" class="tightgraphic2"><img alt="" id="myimage" height="79" src="../Images/EmpireEmblem.jpg" width="30" /></p>

Typically an id attribute isn't required and I've never before received an error for not having one. Also, when something is missing, the error returned usually says such and such is missing, not that it doesn't match some obscure regular expression.

I tried adding an id to the paragraph and the img tags individually and to both but it didn't fix anything.

Thanks for the reply though. Does anyone have any other ideas?

- Byron

st_albert
05-10-2011, 11:18 AM
This is kind of grasping at straws, but are you sure you're looking at the right line? Sometimes the way epubcheck counts lines is different from the way the code is displayed in Sigil, for example. So, maybe the actual error is on some other line nearby?

Like I said, a wild guess... :blink:

bfollowell
05-10-2011, 11:29 AM
This is kind of grasping at straws, but are you sure you're looking at the right line? Sometimes the way epubcheck counts lines is different from the way the code is displayed in Sigil, for example. So, maybe the actual error is on some other line nearby?

Like I said, a wild guess... :blink:

I can't say for certain, no. I'm using the Flightcrew validator option built straight into Sigil though, not another tool, and if I double-click on the error code, it opens the html file in question and takes me right to the line listed, 18. I really don't see anything else close to that line that it could be either. I mean, maybe one tool starts counting from zero and another starts from one. How far could it really be off?!

It's probably something really silly or simple or both but I can't see anything wrong.

- Byron

susan_cassidy
05-10-2011, 11:59 AM
Did you customize anything in the way of regexes? I'm not familiar with \c. I'm a Perl person, not a Python person, but I looked it up in the Python manual, and I don't see \c as a regex atom. In perl, there is a \cx for a control character 'x', but I can't imagine that parsing an id element is looking for a control character.

Could there possibly be an opening or closing quote above the line somewhere that has the wrong quote? E.g. single quote instead of double-quote. Maybe the parser is lost?

bfollowell
05-10-2011, 01:01 PM
^^^

Nope, I haven't cutomized anything, intentionally anyway.

I have a regex cheatsheet and I couldn't find anything listed for \c either. Like you, all I saw was the \cx control character listing.

No wrong quotes anywhere they shouldn't be.

I've searched all over my code and text, five or six lines in either direction from the line in question and I can find absolutely nothing wrong; nothing I haven't done a hundred times over in other ebooks. I really have absolutely no idea what could possibly be causing this error.

- Byron

bfollowell
05-10-2011, 01:13 PM
I've searched all over my code and text, five or six lines in either direction from the line in question and I can find absolutely nothing wrong; nothing I haven't done a hundred times over in other ebooks. I really have absolutely no idea what could possibly be causing this error.

doh!

I spoke too soon.

I pulled one of the html files in question out of the epub manually and dumped it into Notepad++. The lines were numbered differently and when I looked at the line in question, line 18, I saw this:

<h2 class="chaptertitle1 id=" id="nov01ch01">1</h2>

Just like you mentioned, a quote out of place. I must've been typing the id in, got distracted, and started typing it again. Then I cut and pasted this for all of my chapters, just changing the id name and chapter number where needed. That's why it shows up for all of my chapters that have a chapter header.

I'm sure when I go back and remove all of the extra id=" references, everything will be right with the world.

Thanks for the suggestions and helping me step through it. Sometimes you just look at something so much, it's easy to miss something that is obviously staring you right in the face.

- Byron

st_albert
05-11-2011, 12:11 PM
I pulled one of the html files in question out of the epub manually and dumped it into Notepad++. The lines were numbered differently and when I looked at the line in question, line 18, I saw this:

<h2 class="chaptertitle1 id=" id="nov01ch01">1</h2>



That's the issue I was getting at in my post above. I don't know why the line numbers appear to be different in Sigil code view vs. an external text editor, but I see it sometimes myself.

Toxaris
05-11-2011, 03:12 PM
That is easy. Valloric explained it in another part. When you press validate, the epub is created and the epub is then validated. However, the post generation while creating the epub will change the line numbers. That is the reason that the line numbers do not match. It is a known issue.