473,800 Members | 2,614 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automatic W3C validation?

One of my many, many "started with enthusiasm, then quietly abandoned"
projects was to code some PHP which could be included into every page
on my site (blog included) and would verify the page (via the W3C
validator) each time that it was loaded and e-mail me if there were any
problems.

I "quietly abandoned" it when I realized that it was "kewel to kode"
but I don't really know why I wanted it, or how it would work.

On the face of it, I only need to validate each time I change a page.
So, validating with every load seemed ridiculous; which lead me to a
flat file database where I could check the page file's last update date
against its last verification date, thus avoiding unnecessary
validation.

Then it occurred to me that with so many includes (standard header &
footer, etc for menu, hit count, etc), the web page's main file could
be unchanged, but - if an included file were altered - then it might
no longer validate properly.

See my dilemma? So I have put this to one side (since there are plenty
more little projects to code) until I can specify it correctly.

Any comments/suggestions? Anyone know of something similar which
already exists?

Thanks in advance for any fedback.

Jan 3 '06 #1
10 2301
Baron Samedi wrote:
One of my many, many "started with enthusiasm, then quietly abandoned"
projects was to code some PHP which could be included into every page
on my site (blog included) and would verify the page (via the W3C
validator) each time that it was loaded and e-mail me if there were any
problems. <snip> Any comments/suggestions? Anyone know of something similar which
already exists?


http://in.php.net/tidy

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jan 3 '06 #2

R. Rajesh Jeba Anbiah wrote:
Baron Samedi wrote:
One of my many, many "started with enthusiasm, then quietly abandoned"
projects was to code some PHP which could be included into every page
on my site (blog included) and would verify the page (via the W3C
validator) each time that it was loaded and e-mail me if there were any
problems.

<snip>
Any comments/suggestions? Anyone know of something similar which
already exists?


http://in.php.net/tidy


hi, Raj,

rather a cryptic comment, don't you think? How is that supposed to
help?

Jan 4 '06 #3
Faust wrote:
R. Rajesh Jeba Anbiah wrote:
Baron Samedi wrote:
One of my many, many "started with enthusiasm, then quietly abandoned"
projects was to code some PHP which could be included into every page
on my site (blog included) and would verify the page (via the W3C
validator) each time that it was loaded and e-mail me if there were any
problems.

<snip>
Any comments/suggestions? Anyone know of something similar which
already exists?


http://in.php.net/tidy


hi, Raj,

rather a cryptic comment, don't you think? How is that supposed to help?


If you have rather followed the link and read the contents, you
might have realized how helpful it is. I'm personally not for mirroring
php document in c.l.php. I also prefer not to use sock puppet
<http://www.answers.com/sock%20puppet> tricks.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jan 4 '06 #4
I certainly agree that this is very helpful information. I am just not
sure how it answers the question.

Does there already exist some PHP code to invoke the W3C validator
every time that a page is loaded? Is this even a good idea? (maybe it
should be done by cron job?)

Yes, your link is great help for pasring the elements of an HTML page -
no arguement - it just didn't seem to anwser the question, and just
posting the link with no indictaion of why it was relevent doesn't seem
to help.

But, I don't want to start an argument, so please ignore this if it
offends you.

Jan 5 '06 #5
And sorry for the sock puppet. I just switched google accounts without
noticing.

Jan 5 '06 #6

"Faust" <gr****@gmx.net > wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
I certainly agree that this is very helpful information. I am just not
sure how it answers the question.


If you scroll down a little bit on that page you will find:

http://in.php.net/manual/en/function...parse-file.php

Isn't that what you were asking for? You can use tidy to parse, validate and
repair any PHP document. (As long as it generates HTML of course.)

Balazs
Jan 5 '06 #7
Wow! You are correct. That will do it. Sorry, Raj, I missed that,
drowned in information. If you had just added that one sentence it
would have been most helpful.

What I didn't bother to mention, because I didn't think that it was
relevant, was that I have already written code to invoke the W3C
validator and to parse the result. But I can certainly replace it with
this. Thanks to both of you.

Now we have the practical solution of *how* to validate an html page,
and we come to the philosphical questions of *whether* and *when* to
validate it.

Is it a good approach to validate a page each time that it loads?
Probably not, since this adds overhead, both to the page load and to
the W3C servers.

Perhaps each time that it changes? But what if the page doesn't change,
but some include, or its include does? How to know that?

Aha! perhaps I can compute a checksum of the dispalyed page and
validate if that changes. Hmm, no, this is no good on pags with hit
counters or any other variable content which can change but will never
break validation?

Maybe I should just have a cron job to validate my site overnight, or
once a week and email me if anything does not validate.

See what I mean? That's the sort of thing that I would like to disucss.
What do you think?

Thanks in advance

Jan 5 '06 #8

Is it a good approach to validate a page each time that it loads?
Probably not, since this adds overhead, both to the page load and to
the W3C servers.


I have not verified this, but I doubt tidy would add a lot of overhead.
Especially if you have a caching engine running, like Zend Optimizer. If you
run any benchmarks please post the results.

Thanks,
Balazs
Jan 5 '06 #9
Faust wrote:
<snip>
Is it a good approach to validate a page each time that it loads?
Probably not, since this adds overhead, both to the page load and to
the W3C servers.

<snip>

Tidy is an extension and it won't contact W3C servers. Read the
manual closely again. FWIW, check this link too
<http://www.zend.com/php5/articles/php5-tidy.php>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jan 5 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1767
by: Ido | last post by:
Hello, I am searching for an automatic forms creation tool that will help me to save time in developin forms (preferrably with validation). My forms get some data from a MySQL database and are supposed to save all data back to the database. Any recommendations!?
1
3075
by: Fahad Ashfaque | last post by:
Hello, I am getting an xml response from some server which I need to parse. Problem is the xml data contains DTD declaration and the XmlDocument.LoadXml() tries to find the dtd under C:\WINNT\System32 and throws an error. How could i disable this automatic validation? Thanks,
6
5484
by: Gert van der Kooij | last post by:
Hi, It's no problem to define the automatic maintenance using the wizard but I want to use commands to automate automation. I captured the SQL statements when activating the maintenance but that didn't help. I couldn't find anything about it in the docs so if anybody could help with this it would be great. Kind regards, Gert
1
4052
by: Michel Esber | last post by:
Hello, Linux RedHat AS4 running DB2 V8 FP11. I have followed the docs at http://tinyurl.com/qckrn and enabled automatic statistics collection. It has been 2 days since I updated my DB cfg and I don´t see any activity regarding auto runstats. Also, the field STATS_TIME from syscat.tables shows that all my table statistics were last collected in March. What am I missing here ? Is
1
1852
by: Prasanth Nair | last post by:
hi, When I add the following in struts-config.xml, I am getting the below mentioned error while starting the server. /***********************Struts entry**********************/ <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> <set-property property="pathnames" value="/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml"/>
2
1355
by: Gregor Horvath | last post by:
Hi, As I am no expert web programmer I thought I'd better ask the experts if there is a simpler or better solution to my problem than the one I am thinking of. (using TurboGears) The problem ----------- I have a form. Ok. you can submit, validate it etc.
58
4693
by: Jorge Peixoto de Morais Neto | last post by:
I was reading the code of FFmpeg and it seems that they use malloc just too much. The problems and dangers of malloc are widely known. Malloc also has some overhead (although I don't know what is the overhead of automatic variable sized arrays, I suspect it is smaller than that of malloc), although I'm not too worried about it. I was thinking that, with C99's variable length arrays, malloc shouldn't be needed most of the time. But I'm...
3
4655
by: myjish18 | last post by:
Hello, We have a DB2 UDB database v8.2.7 (db2 v8.2 fixpak 14) on AIX 5.3 which has Automatic Storage (AS) enabled. We want to disable automatic storage on entire database and/or disable automatic storage on all tablespaces. DB2 Manual says it once AS is enabled, it cant be changed. Is there any way to disable the AS or any other alternative? Please advice.
3
3674
by: Water Cooler v2 | last post by:
Sorry for asking this beginner question. I've written DTDs so far and read about XML Schemas. I understand that they are a replacement of the DTD fundamentally, and therefore allow for the validation of an XML document. My question really is: Why do we need XML Schemas other than for validation of an XML document? I am more interested in knowing if already available
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10279
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10036
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6815
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.