本文整理匯總了PHP中XMLReader::getAttributeNs方法的典型用法代碼示例。如果您正苦於以下問題:PHP XMLReader::getAttributeNs方法的具體用法?PHP XMLReader::getAttributeNs怎麽用?PHP XMLReader::getAttributeNs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XMLReader
的用法示例。
在下文中一共展示了XMLReader::getAttributeNs方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getWorksheetPaths
/**
* Returns the list of worksheets inside the archive
*
* The keys of the array should be the titles of the worksheets
* The values of the array are the names of the XML worksheet files inside the archive
*
* @param Relationships $relationships
* @param string $path
*
* @return array
*/
public function getWorksheetPaths(Relationships $relationships, $path)
{
$xml = new \XMLReader();
$xml->open($path);
$paths = [];
while ($xml->read()) {
if (\XMLReader::ELEMENT === $xml->nodeType && 'sheet' === $xml->name) {
$rId = $xml->getAttributeNs('id', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
$paths[$xml->getAttribute('name')] = $relationships->getWorksheetPath($rId);
}
}
return $paths;
}
示例2: getAttributeNs
public function getAttributeNs($name, $namespaceURI)
{
return parent::getAttributeNs($name, $namespaceURI);
}
示例3: XMLReader
<?php
/* $Id$ */
$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
<prefix:books xmlns:prefix="uri" isbn="" prefix:isbn="12isbn">book1</prefix:books>';
$reader = new XMLReader();
$reader->XML($xmlstring);
// Only go through
$reader->read();
$reader->read();
$reader->next();
echo $reader->name;
echo " ";
echo $reader->getAttributeNs('isbn', 'uri');
echo "\n";
?>
===DONE===