@@ -523,7 +523,7 @@ public function filter($selector)
523
523
/**
524
524
* Selects links by name or alt value for clickable images.
525
525
*
526
- * @param string $value The link text
526
+ * @param string $value The link text
527
527
*
528
528
* @return Crawler A new instance of Crawler with the filtered list of nodes
529
529
*
@@ -540,7 +540,7 @@ public function selectLink($value)
540
540
/**
541
541
* Selects a button by name or alt value for images.
542
542
*
543
- * @param string $value The button text
543
+ * @param string $value The button text
544
544
*
545
545
* @return Crawler A new instance of Crawler with the filtered list of nodes
546
546
*
@@ -558,7 +558,7 @@ public function selectButton($value)
558
558
/**
559
559
* Returns a Link object for the first node in the list.
560
560
*
561
- * @param string $method The method for the link (get by default)
561
+ * @param string $method The method for the link (get by default)
562
562
*
563
563
* @return Link A Link instance
564
564
*
@@ -597,8 +597,8 @@ public function links()
597
597
/**
598
598
* Returns a Form object for the first node in the list.
599
599
*
600
- * @param array $values An array of values for the form fields
601
- * @param string $method The method for the form
600
+ * @param array $values An array of values for the form fields
601
+ * @param string $method The method for the form
602
602
*
603
603
* @return Form A Form instance
604
604
*
@@ -621,6 +621,28 @@ public function form(array $values = null, $method = null)
621
621
return $ form ;
622
622
}
623
623
624
+ /**
625
+ * Converts string for XPath expressions.
626
+ *
627
+ * Escaped characters are: quotes (") and apostrophe (').
628
+ *
629
+ * Examples:
630
+ * <code>
631
+ * echo Crawler::xpathLiteral('foo " bar');
632
+ * //prints 'foo " bar'
633
+ *
634
+ * echo Crawler::xpathLiteral("foo ' bar");
635
+ * //prints "foo ' bar"
636
+ *
637
+ * echo Crawler::xpathLiteral('a\'b"c');
638
+ * //prints concat('a', "'", 'b"c')
639
+ * </code>
640
+ *
641
+ * @param string $s String to be escaped
642
+ *
643
+ * @return string Converted string
644
+ *
645
+ */
624
646
static public function xpathLiteral ($ s )
625
647
{
626
648
if (false === strpos ($ s , "' " )) {
0 commit comments