本文整理匯總了PHP中XMLElement::getChildElement方法的典型用法代碼示例。如果您正苦於以下問題:PHP XMLElement::getChildElement方法的具體用法?PHP XMLElement::getChildElement怎麽用?PHP XMLElement::getChildElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XMLElement
的用法示例。
在下文中一共展示了XMLElement::getChildElement方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addElement
public function addElement(XMLElement $element)
{
$name = $element->name();
$value = $element->value();
switch ($name) {
// more tags see
// http://code.google.com/apis/kml/documentation/kmlreference.html#polygon
case 'OUTERBOUNDARYIS':
$this->outerBoundary = $element->getChildElement('LINEARRING');
break;
case 'INNERBOUNDARYIS':
$this->innerBoundaries[] = $element->getChildElement('LINEARRING');
break;
default:
parent::addElement($element);
break;
}
}
示例2: addElement
public function addElement(XMLElement $element)
{
$name = $element->name();
$value = $element->value();
switch ($name) {
case 'ICONSTYLE':
$iconChild = $element->getChildElement('ICON');
$this->iconStyle = array(MapStyle::ICON => $iconChild->getProperty('HREF'), MapStyle::WIDTH => $element->getProperty('W'), MapStyle::HEIGHT => $element->getProperty('H'), MapStyle::SCALE => $element->getProperty('SCALE'));
break;
case 'BALLOONSTYLE':
$this->balloonStyle = array(MapStyle::FILLCOLOR => $element->getProperty('BGCOLOR'), MapStyle::COLOR => $element->getProperty('TEXTCOLOR'));
break;
case 'LINESTYLE':
$this->lineStyle = array(MapStyle::COLOR => $element->getProperty('COLOR'), MapStyle::WEIGHT => $element->getProperty('WEIGHT'));
break;
case 'POLYSTYLE':
// if OUTLINE == 1, keep track and use lineStyle for outlines
// if FILL == 1, use supplied color, otherwise just ignore color
$shouldFill = $element->getProperty('FILL');
$color = $shouldFill ? $element->getProperty('COLOR') : null;
$this->polyStyle = array(MapStyle::FILLCOLOR => $color, MapStyle::SHOULD_OUTLINE => $element->getProperty('OUTLINE'));
break;
case 'LABELSTYLE':
$this->labelStyle = array();
break;
case 'LISTSTYLE':
$this->listStyle = array();
break;
case 'PAIR':
$state = $element->getProperty('KEY');
$styleRef = substr($element->getProperty('STYLEURL'), 1);
$style = $this->styleContainer->getStyle($styleRef);
// store the style URL if the parser hasn't yet loaded the associated simple style
if ($state == 'normal') {
$this->normalStyle = $style ? $styleRef : $style;
} else {
if ($state == 'highlighted') {
$this->highlightStyle = $style ? $styleRef : $style;
}
}
break;
default:
parent::addElement($element);
break;
}
}