From 4a183481c33879f68866181e8240fad7ec80ff14 Mon Sep 17 00:00:00 2001 From: Diana Date: Mon, 22 Jun 2015 13:53:01 +0000 Subject: [PATCH] works --- services/Parser/Nodes/Node.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/Parser/Nodes/Node.php b/services/Parser/Nodes/Node.php index c61dcb3..5e9b172 100644 --- a/services/Parser/Nodes/Node.php +++ b/services/Parser/Nodes/Node.php @@ -11,6 +11,7 @@ class Node { const DEFAULT_TAG_NAME = 'default'; const VALUE_TAG_NAME = 'value'; const LABEL_TAG_NAME = 'label'; + const FORMAT_TAG_NAME = 'format'; protected $xmlNode; protected $children; @@ -143,9 +144,12 @@ class Node { } protected function getValueWithDefault( \SimpleXMLElement $xmlNode ) { + $value = $this->extractDataFromSource( $xmlNode ); if ( !$value && $xmlNode->{self::DEFAULT_TAG_NAME} ) { $value = $this->extractDataFromNode( $xmlNode->{self::DEFAULT_TAG_NAME} ); + } elseif ( $value && $xmlNode->{self::FORMAT_TAG_NAME} ) { + $value = $this->extractDataFromNode( $xmlNode->{self::FORMAT_TAG_NAME} ); } return $value;