예제 #1
0
 private function parsePlaceholder(\XMLReader $reader, Node $parentNode)
 {
     $placeholderName = $reader->name;
     $innerParser = $this->getInnerParser();
     $this->seekReaderToNextTag($reader);
     if ($parentNode->hasPlaceholder($placeholderName)) {
         $innerParser->setEndTag($placeholderName);
         $collection = $innerParser->parse($reader, $this->getStylesheetConstraint());
         $placeholder = current($collection->getChildren());
         if ($placeholder) {
             $parentNode->setPlaceholder($placeholderName, $placeholder);
         }
     } else {
         $element = end($this->tagStack);
         throw new ParseException(sprintf('Placeholder "%s" is not supported by "%s" tag.', $placeholderName, $element['tag']));
     }
 }