@@ -95,7 +95,7 @@ To remove a node the anonymous function must return false.
95
95
All filter methods return a new :class: `Symfony\\ Component\\ DomCrawler\\ Crawler `
96
96
instance with filtered content.
97
97
98
- Both :method: `Symfony\\ Component\\ DomCrawler\\ Crawler::filterXPath ` and
98
+ Both the :method: `Symfony\\ Component\\ DomCrawler\\ Crawler::filterXPath ` and
99
99
:method: `Symfony\\ Component\\ DomCrawler\\ Crawler::filter ` methods work with
100
100
XML namespaces, which can be either automatically discovered or registered
101
101
explicitly.
@@ -104,7 +104,7 @@ explicitly.
104
104
Auto discovery and explicit registration of namespaces was introduced
105
105
in Symfony 2.4.
106
106
107
- Consider an XML below:
107
+ Consider the XML below:
108
108
109
109
<?xml version="1.0" encoding="UTF-8"?>
110
110
<entry
@@ -120,7 +120,7 @@ Consider an XML below:
120
120
</media:group>
121
121
</entry>
122
122
123
- It can be filtered with `` DomCrawler `` without a need to register namespace
123
+ This can be filtered with the `` Crawler `` without needing to register namespace
124
124
aliases both with :method: `Symfony\\ Component\\ DomCrawler\\ Crawler::filterXPath `::
125
125
126
126
$crawler = $crawler->filterXPath('//default:entry/media:group//yt:aspectRatio');
@@ -136,21 +136,22 @@ and :method:`Symfony\\Component\\DomCrawler\\Crawler::filter`::
136
136
137
137
The default namespace is registered with a prefix "default". It can be
138
138
changed with the
139
- :method: `Symfony\\ Component\\ DomCrawler\\ Crawler::setDefaultNamespacePrefix `.
139
+ :method: `Symfony\\ Component\\ DomCrawler\\ Crawler::setDefaultNamespacePrefix `
140
+ method.
140
141
141
142
The default namespace is removed when loading the content if it's the only
142
143
namespace in the document. It's done to simplify the xpath queries.
143
144
144
145
Namespaces can be explicitly registered with the
145
- :method: `Symfony\\ Component\\ DomCrawler\\ Crawler::registerNamespace `::
146
+ :method: `Symfony\\ Component\\ DomCrawler\\ Crawler::registerNamespace ` method ::
146
147
147
148
$crawler->registerNamespace('m', 'http://search.yahoo.com/mrss/');
148
149
$crawler = $crawler->filterXPath('//m:group//yt:aspectRatio');
149
150
150
151
.. caution ::
151
152
152
- To query an XML with a CSS selector, the HTML extension needs to be disabled with
153
- :method: `Symfony\\ Component\\ CssSelector\\ CssSelector::disableHtmlExtension `
153
+ To query XML with a CSS selector, the HTML extension needs to be disabled with
154
+ :method: `CssSelector::disableHtmlExtension < Symfony\\ Component\\ CssSelector\\ CssSelector::disableHtmlExtension> `
154
155
to avoid converting the selector to lowercase.
155
156
156
157
Node Traversing
0 commit comments