473,499 Members | 1,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS markup validation

I have found lots of tools to;

1. validate CSS
2. validate HTML
3. check HTML links

But I have so far found nothing to check cross check the style used in
markup with the style sheet to make sure I spelled all the styles as
in class="xxx" correctly. You could consider it a sort of style spell
checker.

Writing one should not be too tough. You extract the style names from
the style sheet with regexes and from the documents with regexes and
list styles in one list but not the other.

I was talking with Albert Wiersch at CSE HTMLValidator. He said the
problem was trickier than it first looks, and that is why his tool
does not handle it.

You could even construct a bulk fix, giving the old/bad name and the
new/good name for style. You could reuse the script to fix your common
typos or to standardise to get rid of aliases.

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/...s_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
Jul 21 '05 #1
1 1594
Roedy Green wrote:
I have found lots of tools to; 1. validate CSS
2. validate HTML
3. check HTML links But I have so far found nothing to check cross check the style used in
markup with the style sheet to make sure I spelled all the styles as
in class="xxx" correctly. You could consider it a sort of style spell
checker. Writing one should not be too tough. You extract the style names from
the style sheet with regexes and from the documents with regexes and
list styles in one list but not the other. I was talking with Albert Wiersch at CSE HTMLValidator. He said the
problem was trickier than it first looks, and that is why his tool
does not handle it. You could even construct a bulk fix, giving the old/bad name and the
new/good name for style. You could reuse the script to fix your common
typos or to standardise to get rid of aliases.


In the meantime, here's a workaround for manual checking in an
organized fashion. The command:

grep -rn --context=0 --color=always class= * | sort | more

recursively (be in your doc root dir) displays a scrollable list of every
line containing string class= , gives the filename and path and line
number of the string, and colorizes the string to make its value easy to find.

http://blinkynet.net/stuff/comp/classgrep.gif

It's not pretty, but a quick scan to look for names that don't look right
should help. And grep/sed gurus might be able to make it a bit more
sophisticated. :)

--
Blinky Linux Registered User 297263
Killing all Usenet posts from Google Groups
Info: http://blinkynet.net/comp/uip5.html
*ALSO contains links for access to the NON-BETA GG archive interface*
Jul 21 '05 #2

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

Similar topics

0
1307
by: Henry S. Thompson | last post by:
I'm pleased to announce that a showcase of Markup Technology's high-performance MT Pipeline product is now available at http://www.markup.co.uk:8888/ The showcase provides online access to a...
38
3574
by: Jukka K. Korpela | last post by:
As well all know, valid markup is important... but when trying to find a convincing modern argument in favor of this, I found pages like http://www.htmlhelp.com/tools/validator/reasons.html which...
16
2909
by: J. C. Denton | last post by:
I just manually validated alexa's global top 100 sites and find only 2 sites that pass validation. They are http://www.microsoft.com/ http://www.wikipedia.org/ All others should go w3c...
4
1481
by: Dotcom | last post by:
ASP.NET generates markup that fails WC3 validation in a number of situations (below): can anyone suggest a way round these? 1. For Command Buttons, the HTML <INPUT type = Image> element rendered...
6
2475
by: yaru22 | last post by:
I'd like to create a program that validates bunch of urls against the w3c markup validator (http://validator.w3.org/) and store the result in a file. Since I don't know network programming, I...
10
1391
by: Ken1 | last post by:
Is there a way to know if the user has javascript on? Also, is it a good idea to validate all input in js and php or will this slow down the website?
1
1604
by: bharati webpro | last post by:
I've tried the W3C MarkUp Validation Service for the following web page: www.chempro.in/index.htm The validation shows 143 errors. Can anyone help me to rectify thes errors please. Thanks.
16
4451
by: Tantale | last post by:
I used this serviec to check my webpage http://www.jmrw.com/Abroad/Barcelone/index.htm Made with Dreamweaver 8. The result is 206 errors, most of them "end tag omitted, but OMITTAG NO was...
9
3589
by: Daniele Perilli | last post by:
Hi everybody, I'd like to introduce you a new little tool I developed to automatically check markup validation of all pages in given websites. It uses W3C HTML Validator and CSS Validator online...
0
8210
drhowarddrfine
by: drhowarddrfine | last post by:
Many people think of validation as a mark of valor so they can put on their web page the little W3C logo proclaiming they have achieved some poetic, high moral platform. In truth, validation is...
0
7174
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,...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7388
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...
0
5470
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,...
0
4600
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...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.