import v1.1.0_RC2 | 2009-09-20
This commit is contained in:
@ -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] . "\')]";'
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
|
||||
@ -24,9 +24,9 @@
|
||||
* @package Zend_Dom
|
||||
* @subpackage Query
|
||||
* @uses Iterator
|
||||
* @copyright Copyright (C) 2008 - Present, Zend Technologies, Inc.
|
||||
* @license New BSD {@link http://framework.zend.com/license/new-bsd}
|
||||
* @version $Id: Result.php 12507 2008-11-10 16:29:09Z matthew $
|
||||
* @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: Result.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
class Zend_Dom_Query_Result implements Iterator,Countable
|
||||
{
|
||||
|
Reference in New Issue
Block a user