Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2010
    Location
    Australia
    Posts
    356
    Thanks
    143
    Thanked 0 Times in 0 Posts

    is there a way to tell validator to ignore deliberate markup validation errors?

    is there a way to tell validator to ignore deliberate markup validation errors?

    all the time, there are non-html codes on my page which don't comply with html validation, but nonetheless get picked up as such. they have a legit role amongst my html and can't be done away with. eg thirdparty widgets, math markup, etc.

    it's annoying for 3 reasons: firstly people in this forum will be led to misperceive me as sloppier than i actually am and don't take me as seriously; second SEO takes a hit, and lastly, it's hard to comb thru a page of hundreds of markup errors just to find the genuine errors i'm interested in fixing.
    The website I am building is http://www.mathannotated.com. My questions often pertain to it. This is my site plan: http://www.mathannotated.com/images/...ctory-tree.gif
    Thank you for your help in all matters. All earnest efforts in helping me will be credited with Thanks. -ptrcao

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,624
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    OK, I assume you’re talking about the site in your signature and I validated the differentiation intro page, and really, most of the errors don’t seem deliberate due to any math markup or third party widgets (FB Like button) but simply because you:

    1. Forgot to encode special characters as HTML entities (like ampersands as &amp;, < as &lt; etc.)
    2. Are using an inline frame although this is not allowed with a strict doctype (OK, I see this is from an Amazon widget)
    3. Didn’t to implement the FB Like button properly, using the respective xmlns attribute in your opening <html> tag (and putting the respective meta tags which apparently don’t validate by themselves but with a little workaround: http://stackoverflow.com/questions/2...answer-3221120)
    4. Forgot to close some elements properly.


    You can get rid of most of the errors already if you encode any occurrence of & as &amp;. It’s unfortunate that Amazon provides an iframe for the widget but if you really need the pages to validate then add that iframe with JS or something. I’m kinda happy that you are using the XHTML strict doctype so I wouldn’t want you to resort to transitional (where iframes – among a lot of other crap – would be regarded as valid). Another option – although I don’t know how the current state of support is (especially in IE) – is to replace the iframe with an object element since not only you can include Flash with the object element but also other things like HTML or PDF documents: http://joliclic.free.fr/html/object-tag/en/.

  • Users who have thanked VIPStephan for this post:

    ptrcao (02-12-2011)

  • #3
    Regular Coder
    Join Date
    Dec 2010
    Location
    Australia
    Posts
    356
    Thanks
    143
    Thanked 0 Times in 0 Posts
    Thanks VIPSteve; right, I've not been especially motivated to clean up that particular page because it's rampant with errors from the Amazon widget, making it difficult to sift through and pick up my own errors...

    http://validator.w3.org/check?uri=ht...Inline&group=0

    To show you what I mean, it's difficult to avoid this kind of thing:

    Here is an example of math markup where the "&" symbol has no choice but to remain as such; cannot encode as "&amp;" as the program reading this needs to see "&". (It's being used as an alignment marker.)
    …t{conjugate}}{\text{conjugate}}$)} \\ &=\lim_{h \rightarrow 0} \frac{(16+h)-16…

    I'll definitely follow up with your useful suggestions. Did the results of that validation test really suggest that my errors outnumbered the amazon widget errors? I didn't know my errors were that bad!

    I'll definitely be interested to try your solution to clean up the path of destruction left by this troublesome little amazon widget.
    The website I am building is http://www.mathannotated.com. My questions often pertain to it. This is my site plan: http://www.mathannotated.com/images/...ctory-tree.gif
    Thank you for your help in all matters. All earnest efforts in helping me will be credited with Thanks. -ptrcao

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,624
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    Well, maybe it helps to denote the math markup as “character data” (CDATA – as opposed to PCDATA: parsed character data)?

    Should do the trick if you write it like:
    Code:
    <li> The gradient of tangent, denoted \( y'(x) \) is a limit of the form
    <![CDATA[
    \begin{align*}
     \lim_{h \rightarrow 0} \frac{y_2-y_1}{x_2-x_1}
    &= \lim_{h \rightarrow 0} \frac{f(x_2)-f(x_1)}{x_2-x_1} \\
    
    &= \lim_{h \rightarrow 0} \frac{f(x_1+h)-f(x_1)}{(x_1+h)-{x_1}} \\
    &= \lim_{h \rightarrow 0} \frac{f(x_1+h)-f(x_1)}{h} 
    \end{align*}
    ]]>
    </li>
    Now, the iframe can’t be valid in strict XHTML since it itself is not allowed. But you’ll at least get less errors if you, as I said, encode the ampersands in the URL as &amp; (don’t worry, the URL will still work) and remove the nevertheless invalid attributes like marginwidth/marginheight, etc. To get it completely valid you can try to convert the iframe to an object like this:

    Code:
    <object type="text/html" data="http://rcm.amazon.com/e/cm?t=mathanno-20&amp;o=1&amp;p=6&amp;l=st1&amp;mode=books&amp;search=math%20trigonometry&amp;fc1=000000&amp;lt1=&amp;lc1=3366FF&amp;bg1=FFFFFF&amp;f=ifr" style="border:none; width: 120px; height: 150px;">(alternative content here, e. g. the plain link to the source)</object>
    However, as proper support was always limited in some browsers, especially when it comes to styling. I don’t know how the current state is as I haven’t tried this for a few years.

  • Users who have thanked VIPStephan for this post:

    ptrcao (02-12-2011)

  • #5
    Regular Coder
    Join Date
    Dec 2010
    Location
    Australia
    Posts
    356
    Thanks
    143
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    Well, maybe it helps to denote the math markup as “character data” (CDATA – as opposed to PCDATA: parsed character data)?

    Should do the trick if you write it like:
    Code:
    <li> The gradient of tangent, denoted \( y'(x) \) is a limit of the form
    <![CDATA[
    \begin{align*}
     \lim_{h \rightarrow 0} \frac{y_2-y_1}{x_2-x_1}
    &= \lim_{h \rightarrow 0} \frac{f(x_2)-f(x_1)}{x_2-x_1} \\
    
    &= \lim_{h \rightarrow 0} \frac{f(x_1+h)-f(x_1)}{(x_1+h)-{x_1}} \\
    &= \lim_{h \rightarrow 0} \frac{f(x_1+h)-f(x_1)}{h} 
    \end{align*}
    ]]>
    </li>
    Now, the iframe can’t be valid in strict XHTML since it itself is not allowed. But you’ll at least get less errors if you, as I said, encode the ampersands in the URL as &amp; (don’t worry, the URL will still work) and remove the nevertheless invalid attributes like marginwidth/marginheight, etc. To get it completely valid you can try to convert the iframe to an object like this:

    Code:
    <object type="text/html" data="http://rcm.amazon.com/e/cm?t=mathanno-20&amp;o=1&amp;p=6&amp;l=st1&amp;mode=books&amp;search=math%20trigonometry&amp;fc1=000000&amp;lt1=&amp;lc1=3366FF&amp;bg1=FFFFFF&amp;f=ifr" style="border:none; width: 120px; height: 150px;">(alternative content here, e. g. the plain link to the source)</object>
    However, as proper support was always limited in some browsers, especially when it comes to styling. I don’t know how the current state is as I haven’t tried this for a few years.
    Thanks, very helpful.

    I've always been scared to edit third party scripts. I worry that Amazon might consider it a violation of their policy and cancel my account with them... Any experience with this sort of thing? In this case it seems like a trivial and superficial edit, but to be on the safe side I should establish it is ok first.
    The website I am building is http://www.mathannotated.com. My questions often pertain to it. This is my site plan: http://www.mathannotated.com/images/...ctory-tree.gif
    Thank you for your help in all matters. All earnest efforts in helping me will be credited with Thanks. -ptrcao


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •