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,8 +14,9 @@
*
* @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
* @version $Id: Exception.php 16541 2009-07-07 06:59:03Z bkarwin $
*/
/** Zend_Exception */
@ -26,8 +27,8 @@ require_once 'Zend/Exception.php';
*
* @category Zend
* @package Zend_Dom
* @copyright Copyright (C) 2008 - Present, Zend Technologies, Inc.
* @license New BSD {@link http://framework.zend.com/license/new-bsd}
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Dom_Exception extends Zend_Exception
{

View File

@ -14,8 +14,9 @@
*
* @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
* @version $Id: Query.php 17293 2009-07-30 02:34:37Z yoshida@zend.co.jp $
*/
/**
@ -30,11 +31,11 @@ require_once 'Zend/Dom/Query/Result.php';
/**
* Query DOM structures based on CSS selectors and/or XPath
*
*
* @package Zend_Dom
* @subpackage Query
* @copyright Copyright (C) 2008 - Present, Zend Technologies, Inc.
* @license New BSD {@link http://framework.zend.com/license/new-bsd}
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Dom_Query
{
@ -59,25 +60,26 @@ class Zend_Dom_Query
/**
* Constructor
*
* @param null|string $document
*
* @param null|string $document
* @return void
*/
public function __construct($document = null)
{
if (null !== $document) {
$this->setDocument($document);
}
$this->setDocument($document);
}
/**
* Set document to query
*
* @param string $document
*
* @param string $document
* @return Zend_Dom_Query
*/
public function setDocument($document)
{
if (0 === strlen($document)) {
return $this;
}
if ('<?xml' == substr(trim($document), 0, 5)) {
return $this->setDocumentXml($document);
}
@ -88,9 +90,9 @@ class Zend_Dom_Query
}
/**
* Register HTML document
*
* @param string $document
* Register HTML document
*
* @param string $document
* @return Zend_Dom_Query
*/
public function setDocumentHtml($document)
@ -102,8 +104,8 @@ class Zend_Dom_Query
/**
* Register XHTML document
*
* @param string $document
*
* @param string $document
* @return Zend_Dom_Query
*/
public function setDocumentXhtml($document)
@ -115,8 +117,8 @@ class Zend_Dom_Query
/**
* Register XML document
*
* @param string $document
*
* @param string $document
* @return Zend_Dom_Query
*/
public function setDocumentXml($document)
@ -128,7 +130,7 @@ class Zend_Dom_Query
/**
* Retrieve current document
*
*
* @return string
*/
public function getDocument()
@ -138,7 +140,7 @@ class Zend_Dom_Query
/**
* Get document type
*
*
* @return string
*/
public function getDocumentType()
@ -148,8 +150,8 @@ class Zend_Dom_Query
/**
* Perform a CSS selector query
*
* @param string $query
*
* @param string $query
* @return Zend_Dom_Query_Result
*/
public function query($query)
@ -160,8 +162,8 @@ class Zend_Dom_Query
/**
* Perform an XPath query
*
* @param string $xpathQuery
*
* @param string|array $xpathQuery
* @param string $query CSS selector query
* @return Zend_Dom_Query_Result
*/
@ -196,7 +198,7 @@ class Zend_Dom_Query
/**
* Prepare node list
*
*
* @param DOMDocument $document
* @param string|array $xpathQuery
* @return array

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] . "\')]";'

View File

@ -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
{