added a node about HTML extension in readme
This commit is contained in:
parent
0da84dac18
commit
0cb95e07ac
@ -10,6 +10,28 @@ equivalents:
|
|||||||
|
|
||||||
print CssSelector::toXPath('div.item > h4 > a');
|
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
|
Resources
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user