Skip to content

Commit daf5d3c

Browse files
committed
[#2979] Minor tweaks
1 parent baec6de commit daf5d3c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

components/dom_crawler.rst

+8-7
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ To remove a node the anonymous function must return false.
9595
All filter methods return a new :class:`Symfony\\Component\\DomCrawler\\Crawler`
9696
instance with filtered content.
9797

98-
Both :method:`Symfony\\Component\\DomCrawler\\Crawler::filterXPath` and
98+
Both the :method:`Symfony\\Component\\DomCrawler\\Crawler::filterXPath` and
9999
:method:`Symfony\\Component\\DomCrawler\\Crawler::filter` methods work with
100100
XML namespaces, which can be either automatically discovered or registered
101101
explicitly.
@@ -104,7 +104,7 @@ explicitly.
104104
Auto discovery and explicit registration of namespaces was introduced
105105
in Symfony 2.4.
106106

107-
Consider an XML below:
107+
Consider the XML below:
108108

109109
<?xml version="1.0" encoding="UTF-8"?>
110110
<entry
@@ -120,7 +120,7 @@ Consider an XML below:
120120
</media:group>
121121
</entry>
122122

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
124124
aliases both with :method:`Symfony\\Component\\DomCrawler\\Crawler::filterXPath`::
125125

126126
$crawler = $crawler->filterXPath('//default:entry/media:group//yt:aspectRatio');
@@ -136,21 +136,22 @@ and :method:`Symfony\\Component\\DomCrawler\\Crawler::filter`::
136136

137137
The default namespace is registered with a prefix "default". It can be
138138
changed with the
139-
:method:`Symfony\\Component\\DomCrawler\\Crawler::setDefaultNamespacePrefix`.
139+
:method:`Symfony\\Component\\DomCrawler\\Crawler::setDefaultNamespacePrefix`
140+
method.
140141

141142
The default namespace is removed when loading the content if it's the only
142143
namespace in the document. It's done to simplify the xpath queries.
143144

144145
Namespaces can be explicitly registered with the
145-
:method:`Symfony\\Component\\DomCrawler\\Crawler::registerNamespace`::
146+
:method:`Symfony\\Component\\DomCrawler\\Crawler::registerNamespace` method::
146147

147148
$crawler->registerNamespace('m', 'http://search.yahoo.com/mrss/');
148149
$crawler = $crawler->filterXPath('//m:group//yt:aspectRatio');
149150

150151
.. caution::
151152

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>`
154155
to avoid converting the selector to lowercase.
155156

156157
Node Traversing

0 commit comments

Comments
 (0)