My question is rather simple and I'll try to create a linear visual...
1.) User $_POST CSS data to form -->
2.) Server passes form data to W3C validator
3.) Validator returns 'valid' or 'invalid' result.
4.) Able to echo 'valid' or 'invalid' to the user.
So in essence I want to know if it's possible to validate CSS data on my site but using the W3C CSS validator?
Validate CSS $_POST using W3C validator?
Moderator: General Moderators
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Validate CSS $_POST using W3C validator?
You can send the request to the w3 validator SOAP service and parse the results.
http://jigsaw.w3.org/css-validator/api.html
http://jigsaw.w3.org/css-validator/api.html
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Validate CSS $_POST using W3C validator?
So essentially would I use PHP to read the XML file's m:validity element to simply check and see if the user's code posted to my site that I passed on to W3C's soap widget is valid or not?
Re: Validate CSS $_POST using W3C validator?
Correct. You don't even have to use PHP - if you use AJAX to send the request, Javascript has excellent XML parsing and traversal capabilities.
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Validate CSS $_POST using W3C validator?
I'd actually prefer to have the server directly receive the validation in case the user disables JavaScript once at the form and then submits the data.
Are there any working examples/tutorials I can learn from?
Are there any working examples/tutorials I can learn from?
Re: Validate CSS $_POST using W3C validator?
Not that I know of, but it seems pretty straightforward
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Validate CSS $_POST using W3C validator?
If it seems straight forward and there are no tutorials or examples of code then could you please post some example so that I could actually learn how to use it?