Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9c3ee7e

Browse files
committed
[CssSelector] updated README
1 parentac17232 commit9c3ee7e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

‎src/Symfony/Component/CssSelector/README.md‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,23 @@ The component only goal is to convert CSS selectors to their XPath
77
equivalents:
88

99
```php
10-
use Symfony\Component\CssSelector\CssSelector;
10+
use Symfony\Component\CssSelector\CssSelectorConverter;
1111

12-
print CssSelector::toXPath('div.item > h4 > a');
12+
$converter = new CssSelectorConverter();
13+
print $converter->toXPath('div.item > h4 > a');
1314
```
1415

1516
HTML and XML are different
1617
--------------------------
1718

1819
The`CssSelector` component comes with an`HTML` extension which is enabled by
1920
default. If you need to use this component with`XML` documents, you have to
20-
disable this`HTML` extension. That's because,`HTML` tag & attribute names
21-
arealways lower-cased, but case-sensitive in`XML`:
21+
disable this`HTML` extension. That's because,`HTML` tag & attribute names are
22+
always lower-cased, but case-sensitive in`XML`:
2223

2324
```php
2425
// disable `HTML` extension:
25-
CssSelector::disableHtmlExtension();
26-
27-
// re-enable `HTML` extension:
28-
CssSelector::enableHtmlExtension();
26+
$converter = new CssSelectorConverter(false);
2927
```
3028

3129
When the`HTML` extension is enabled, tag names are lower-cased, attribute

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp