Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[CssSelector] added a node about HTML extension in readme #8287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/Symfony/Component/CssSelector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------

Expand Down