Validating attribute values

November 26th, 2007 by Henri Sivonen

Traditionally, SGML-based HTML validation has treated most attribute values as “anything goes” strings. This has meant that all kinds of bogus values have passed as valid. W3C XML Schema added a fixed set of datatypes. The spec is mostly useless for HTML5 validation, since the HTML5 microsyntaxes do not match exactly the XSD datatypes for the same concepts. XSD regular expressions were suitable for representing the syntax of a number of HTML5 microsyntaxes, though. XSD datatypes can be used from RELAX NG and Validator.nu used to XSD regular expressions for many HTML5 microsyntaxes.

The problem with using XSD regular expressions has been that they are not user-friendly. When an attribute value did not match the required regular expression, the UI told the user that the attribute value was “bad”. Nothing else.

Fortunately, unlike XSD, RELAX NG allows pluggable datatype libraries. A datatype library is a library written in a general-purpose programming language. The RELAX NG engine calls the library to check if a string conforms to a named datatype. Validator.nu has used this approach for a long time for the more complex microsyntaxes in HTML5.

I have recently made an effort to move Validator.nu away from XSD regular expressions to a more comprehensive custom datatype library. Even though as a formalism regular expressions are sufficient for many syntaxes, writing checking by hand allows more useful error messages in cases of failure. Moreover, having identifiers for the datatypes makes it possible to tell which datatype failed as opposed to the UI being able to tell that some regular expression failed under the hood. This allows the UI to pull in per-datatype advice from a wiki page.

In addition to improving the user experience with previously supported microsyntaxes such as integers, I have implemented support for previously unsupported microsyntaxes such as MIME types and Media Queries.

There is still work to do. For example, the syntaxes for accept-charset and WF2 type=email are not done. data: and mailto: IRIs are not properly validated yet. The syntaxes for image map coordinates still use XSD regular expressions. The advice on the wiki page is far from complete. (You can help!)

For the parts already implemented, please try the new features out and let me know what needs improvement.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

purchase tramadol Carisoprodol Prescription order ultram; "hoodia gordonii" Phentermine Prices "vicodin prescription" 50 tramadol Order Carisoprodol Online Tramadol com tramadol hcl 991. cheap ambien Order Valium diet pills adipex cheap ultram; Vicodin For Sale Legal vicodin norco hydrocodone 927. order phentermine Phentermine Pharmacy order carisoprodol

phentermine sales,

Valium No Prescription ultram 50 mg phentermine prescriptions Xanax Xr phentermine without prescription ultram online Hoodia Gordoni ultram online tramadol 50mg, Buy Vicodin Online oxycodone vs hydrocodone 37.5 phentermine Phentermine Com vicadin xanax without prescription Ultram Buy hoodia weight buy lorazepam online

Hydrocodone Vicodin

tramadol prescription ionamin online Vicoden "hydrocodone 10" buy cheap soma Ultram Online phentermine for sale buy tramadol online Hydrocodone Lortab xanex, vicodin 500 Hydrocodone Pain "fastin" Cheapest phentermine com fastin 820. Phentermine Adipex hydrocodone drugs; phentermine on line Tramadol Sale ionamin diet pill buy xanax Buy Carisoprodol Online alprazolam online? rx phentermine; Order Valium Online alprazolam prescription, ionamin prescription Buy Ultram Online phentermine sale Buy valium online without a prescription order valium 315. Lorazepam Prescription ionamin diet pill alprazolam discount; Acomplia Hydrocodone apap hydrocodone canada 723. www ultram com Vicodin Hydrocodone adipex online phentermine on line 37.5 Phentermine "generic adipex" "buy zolpidem" Com Fastin order vicodin online order tramadol? Carisoprodol Soma drug fastin order alprazolam Adipex Pharmacy adipex p Hydrocodone apap hydrocodone canada 723. Hydrocodone buy phentermine online xanax prescription Vicodin Com ionamin diet pill purchase phentermine online Buy Ambien Online adipex pills purchase tramadol Ultram 50 Mg adipex no prescription Adipex adipex 37.5 992. Cheap Ultram buy ambien online adipex pills Xenical Prices online xanax! get phentermine Tramadol Cod Buy ativan online buy cheap xanax 352. buy carisoprodol online Ic Hydrocodone Apap buy soma discount carisoprodol Get Tramadol generic tramadol; fastin prescription! Darvocet Vicodin phentermine price discount valium online Cheap Adipex carisoprodol 350 compare phentermine Soma Prescription com fastin! xenical tablets Cheapest Tramadol Hydrocodone acetaminophen hydrocodone apap 843. ultram com Phentermine Hcl vicodin hp! adipex 37.5 50 Tramadol diazepam prescription order ultram online; Online Hydrocodone lorazepam online discount valium Buy Ativan tramadol rx buy carisoprodol Hydrocodone Cheap hydrocodone "get tramadol" Buy Cheap Tramadol tramadol sale ultram 50 Order Ativan ultram price phentermine on line Online Xanax adipex pill carisoprodol 350mg Overnight Tramadol "vicodin generic" online pharmacy phentermine Online Vicodin hydrocodone medication valium online; Vicodin Lortab cheap soma phentermine on line Buy Ambien order valium online xenical prices Phentermine Prescriptions alprazolam buy cheap adipex! Xenical Price phentermine price adipex com Ativan vicodin tablets, generic tramadol; Meridia Phentermine cheap valium drugs vicodin Alprazolam 2mg ionamin ic hydrocodone apap Order Soma order valium online discount phentermine Buy Cheap Phentermine low cost phentermine adipex 37.5 mg Diazepam 10mg xanax pharmacy vicodin com Ionamin medication tramadol, generic ambien Phentermine Diet Pill xanax no prescription discount soma Soma Pharmacy ultram er! generic hydrocodone, Tramadol Hcl order ultram; overnight tramadol Xenical Pill vicodin for sale order xanax Alprazolam 0.5mg cheap soma Phentermine diet phentermine diet pill 186. Buy Lorazepam Online phentermine 90 Phentermine weight loss phentermine without a prescription 989. Buy Tramadol Online buy lorazepam online "generic adipex" Phentermine On Line ultram tramadol hcl? Buy Soma Online phentermine hcl tramadol hydrochloride Hydrocodone 7.5 xanax prescription online vicodin Adipex Com xanax drug buy valium no prescription Zolpidem ambien online hydrocodone pill Vicodin 500 tramadol sale "www adipex com"
Hydrocodone Apap
tramadol alprazolam online pharmacy; Ultram Prescription ativan lorazepam tramadol sale Diet Adipex phentermine on line vicodin Legal Vicodin compare phentermine adipex sale Hydrocodone Mg tramadol pharmacy

alprazolam generic

Ultram Er

diazepam 5mg ambien generic Hydrocodone Acetaminophen xanax drug Hydrocodone pain hydrocodone pill 870. Hoodia Weight tramadol hcl? order valium online Tramadol Pharmacy ultram com

Legal vicodin norco hydrocodone 927.

Phentermine Capsules "vicodin prescription" vicodin com Hydrocodone For Sale Tramadol com tramadol hcl 991. cheap ambien Phentermine Price diet pills adipex cheap ultram; Cheap Soma Legal vicodin norco hydrocodone 927. order phentermine Ultram order carisoprodol phentermine sales, Adipex Ionamin ultram 50 mg prescription phentermine Diazepam Pharmacy phentermine without prescription ultram online Hydrocodone 500 ultram online tramadol 50mg, Get Phentermine oxycodone vs hydrocodone adipex no prescription Tramadolultram vicadin xanax without prescription Cheap Tramadol hoodia weight buy lorazepam online Fastin Prescription tramadol prescription phentermine 90 Order Tramadol "hydrocodone 10" buy cheap soma Generic Hydrocodone phentermine for sale buy tramadol online Generic Valium xanex, vicodin 500 Diazepam 5mg "fastin" Cheapest phentermine com fastin 820. Buy Alprazolam Online hydrocodone drugs; phentermine on line Adipex Without Prescription ionamin diet pill buy xanax Phentermine Without A Prescription alprazolam online? purchase phentermine
Alprazolam Prescription
alprazolam prescription, hoodia diet pill

Buying Vicodin

Buy valium online without a prescription order valium 315. diet pills phentermine Vicodin Prescription alprazolam discount; Hydrocodone apap hydrocodone canada 723. Hydrocodone Medication www ultram com adipex online Ativan Prescription phentermine on line "generic adipex" Taking Phentermine diazepam 10mg online vicodin Xenical Sales order tramadol? drug fastin Buy Xanax Online order alprazolam adipex p Purchase Tramadol Hydrocodone apap hydrocodone canada 723. buy phentermine online Purchase Hydrocodone xanax prescription ionamin diet pill Phentermine Canada www adipex! adipex diet pill Phentermine 15 purchase tramadol adipex no prescription Adipex Drug Adipex adipex 37.5 992. buy ambien online Xanax Com adipex pills online xanax! Ionamine get phentermine Buy ativan online buy cheap xanax 352. Order Adipex buy carisoprodol online buy soma Hydrocodone Canada generic soma generic tramadol; Buy Zolpidem fastin prescription! phentermine price Ultram Tramadol discount valium online carisoprodol 350 Drugs Vicodin compare phentermine buy phentermine online No Prescription Phentermine xenical tablets Hydrocodone acetaminophen hydrocodone apap 843. Buy Carisoprodol ultram com vicodin hp! Www Adipex adipex com diazepam prescription Carisoprodol 350mg order ultram online; lorazepam online Alprazolam 1mg discount valium tramadol rx Ultram Pharmacy buy carisoprodol hydrocodone Online Pharmacy Phentermine "get tramadol" tramadol sale Tramadol Online ultram 50 ultram price Xanex phentermine on line adipex pill Generic Xanax carisoprodol 350mg vicodin for sale Valium online pharmacy phentermine hydrocodone medication Generic Soma valium online; cheap soma Prescription Adipex Online phentermine on line order valium online Vicodin Medication xenical prices alprazolam buy Hoodia Diet cheap adipex! phentermine price Buy Valium Online Without A Prescription adipex com "vicodin prescription" Hydrocodone Pill generic tramadol; cheap valium Vicodin Without Prescription drugs vicodin ionamin Ativan Com ic hydrocodone apap order valium online Xanax Without Prescription discount phentermine low cost phentermine Alprazolam adipex 37.5 mg xanax pharmacy Adipex No Prescription vicodin on line medication tramadol, Buy Ionamin Online generic ambien xanax no prescription Www Ultram Com discount soma ultram er! Buy Ativan Online generic hydrocodone, order ultram; Xanax Prescription overnight tramadol vicodin for sale Alprazolam Xr order xanax cheap soma Generic Tramadol Phentermine diet phentermine diet pill 186. phentermine 90 Xanax 1mg Phentermine weight loss phentermine without a prescription 989. buy lorazepam online Www Alprazolam "generic adipex" ultram 2mg Xanax tramadol hcl? phentermine hcl Order Ultram tramadol hydrochloride xanax prescription Phentermine 30mg online vicodin xanax drug Hoodia Gordonii buy valium no prescription ambien online Alprazolam Discount hydrocodone pill tramadol online Buy Cheap Xanax "www adipex com" overnight tramadol Buy Hydrocodone Buy ativan online buy cheap xanax 352.

"));