import v1.1.0_RC2 | 2009-09-20

This commit is contained in:
2019-07-17 22:19:00 +02:00
parent 3b7ba80568
commit 38c146901c
2504 changed files with 101817 additions and 62316 deletions

View File

@ -14,26 +14,26 @@
*
* @category Zend
* @package Zend_Dom
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* Transform CSS selectors to XPath
*
* Transform CSS selectors to XPath
*
* @package Zend_Dom
* @subpackage Query
* @copyright Copyright (C) 2007 - Present, Zend Technologies, Inc.
* @license New BSD {@link http://framework.zend.com/license/new-bsd}
* @version $Id: Css2Xpath.php 11013 2008-08-24 21:06:20Z thomas $
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Css2Xpath.php 17293 2009-07-30 02:34:37Z yoshida@zend.co.jp $
*/
class Zend_Dom_Query_Css2Xpath
{
/**
* Transform CSS expression to XPath
*
* @param string $path
* @return string
*
* @param string $path
* @return string|array
*/
public static function transform($path)
{
@ -84,8 +84,8 @@ class Zend_Dom_Query_Css2Xpath
/**
* Tokenize CSS expressions to XPath
*
* @param string $expression
*
* @param string $expression
* @return string
*/
protected static function _tokenize($expression)
@ -100,7 +100,7 @@ class Zend_Dom_Query_Css2Xpath
// arbitrary attribute strict equality
if (preg_match('|([a-z]+)\[([a-z0-9_-]+)=[\'"]([^\'"]+)[\'"]\]|i', $expression)) {
$expression = preg_replace_callback(
'|([a-z]+)\[([a-z0-9_-]+)=[\'"]([^\'"]+)[\'"]\]|i',
'|([a-z]+)\[([a-z0-9_-]+)=[\'"]([^\'"]+)[\'"]\]|i',
create_function(
'$matches',
'return $matches[1] . "[@" . strtolower($matches[2]) . "=\'" . $matches[3] . "\']";'
@ -112,7 +112,7 @@ class Zend_Dom_Query_Css2Xpath
// arbitrary attribute contains full word
if (preg_match('|([a-z]+)\[([a-z0-9_-]+)~=[\'"]([^\'"]+)[\'"]\]|i', $expression)) {
$expression = preg_replace_callback(
'|([a-z]+)\[([a-z0-9_-]+)~=[\'"]([^\'"]+)[\'"]\]|i',
'|([a-z]+)\[([a-z0-9_-]+)~=[\'"]([^\'"]+)[\'"]\]|i',
create_function(
'$matches',
'return $matches[1] . "[contains(@" . strtolower($matches[2]) . ", \' $matches[3] \')]";'
@ -124,7 +124,7 @@ class Zend_Dom_Query_Css2Xpath
// arbitrary attribute contains specified content
if (preg_match('|([a-z]+)\[([a-z0-9_-]+)\*=[\'"]([^\'"]+)[\'"]\]|i', $expression)) {
$expression = preg_replace_callback(
'|([a-z]+)\[([a-z0-9_-]+)\*=[\'"]([^\'"]+)[\'"]\]|i',
'|([a-z]+)\[([a-z0-9_-]+)\*=[\'"]([^\'"]+)[\'"]\]|i',
create_function(
'$matches',
'return $matches[1] . "[contains(@" . strtolower($matches[2]) . ", \'" . $matches[3] . "\')]";'