added a node about HTML extension in readme

This commit is contained in:
Jean-François Simon 2013-06-16 11:03:18 +02:00 committed by Fabien Potencier
parent 0da84dac18
commit 0cb95e07ac
1 changed files with 22 additions and 0 deletions

View File

@ -10,6 +10,28 @@ equivalents:
print CssSelector::toXPath('div.item > h4 > a');
HTML and XML are different
--------------------------
- The `CssSelector` component comes with an `HTML` extension which is enabled by default.
- If you need to use this component with `XML` documents, you have to disable `HTML` extension.
- `HTML` tag & attribute names are always lower-cased, with `XML` they are case-sensistive.
Disable & enable `HTML` extension:
// disable `HTML` extension:
CssSelector::disableHtmlExtension();
// re-enable `HTML` extension:
CssSelector::enableHtmlExtension();
What brings `HTML` extension?
- Tag names are lower-cased
- Attribute names are lower-cased
- Adds following pseudo-classes:
- `checked`, `link`, `disabled`, `enabled`, `selected`: used with form tags
- `invalid`, `hover`, `visited`: always select nothing
- Adds `lang()` function
Resources
---------