Changeset 96
- Timestamp:
- 03/29/07 14:26:25 (1 year ago)
- Files:
-
- trunk/XJConf/XmlParser.php (modified) (4 diffs)
- trunk/examples/xml/test-classloader.xml (modified) (1 diff)
- trunk/examples/xml/test-extension.xml (modified) (1 diff)
- trunk/examples/xml/test-xinclude-included.xml (modified) (1 diff)
- trunk/examples/xml/test-xinclude.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/XJConf/XmlParser.php
r94 r96 59 59 * @var string 60 60 */ 61 private $myNamespace = 'http:// www.schst.net/XJConf';61 private $myNamespace = 'http://xjconf.net/XJConf'; 62 62 /** 63 63 * stack of currently opened files … … 152 152 $attributes = array(); 153 153 if (TRUE == $reader->hasAttributes) { 154 // go to first attribute155 $attribute = $reader->moveToFirstAttribute();156 // save data of all attributes157 while (TRUE == $attribute) {158 $attributes[$reader->localName] = $reader->value;159 $attribute = $reader->moveToNextAttribute();160 }161 }154 // go to first attribute 155 $attribute = $reader->moveToFirstAttribute(); 156 // save data of all attributes 157 while (TRUE == $attribute) { 158 $attributes[$reader->localName] = $reader->value; 159 $attribute = $reader->moveToNextAttribute(); 160 } 161 } 162 162 163 163 $this->startElement($nameSpaceURI, $elementName, $attributes); … … 307 307 $result = $this->extensions[$namespaceURI]->endElement($this, $tag); 308 308 if (null != $result) { 309 if (1 == $this->depth) {310 $this->config[$tag->getKey()] = $result->getConvertedValue();311 } else {312 $parent = array_pop($this->tagStack);313 if ($result->getKey() == null && $parent->supportsIndexedChildren() == false) {314 $parent->setContent($result->getConvertedValue());315 } else {316 $parent->addChild($result);317 }318 array_push($this->tagStack, $parent);319 }309 if (1 == $this->depth) { 310 $this->config[$tag->getKey()] = $result->getConvertedValue(); 311 } else { 312 $parent = array_pop($this->tagStack); 313 if ($result->getKey() == null && $parent->supportsIndexedChildren() == false) { 314 $parent->setContent($result->getConvertedValue()); 315 } else { 316 $parent->addChild($result); 317 } 318 array_push($this->tagStack, $parent); 319 } 320 320 } 321 321 // last tag before returning to root 322 322 } elseif (1 == $this->depth) { 323 $this->config[$tag->getKey()] = $tag->getConvertedValue();324 // add this tag to the tag before as child325 } else {326 $parent = array_pop($this->tagStack);327 $parent->addChild($tag);328 array_push($this->tagStack, $parent);323 $this->config[$tag->getKey()] = $tag->getConvertedValue(); 324 // add this tag to the tag before as child 325 } else { 326 $parent = array_pop($this->tagStack); 327 $parent->addChild($tag); 328 array_push($this->tagStack, $parent); 329 329 } 330 330 } … … 341 341 { 342 342 if (count($this->tagStack) == 0) { 343 return;343 return; 344 344 } 345 345 trunk/examples/xml/test-classloader.xml
r46 r96 1 1 <xj:configuration 2 xmlns:xj="http://www.schst.net/XJConf"3 xmlns:cl="http://xjconf.net/example/ClassLoader">4 <cl:nestedClass />5 <cl:otherClass />2 xmlns:xj="http://xjconf.net/XJConf" 3 xmlns:cl="http://xjconf.net/example/ClassLoader"> 4 <cl:nestedClass /> 5 <cl:otherClass /> 6 6 </xj:configuration> trunk/examples/xml/test-extension.xml
r34 r96 1 1 <xj:configuration 2 xmlns:xj="http://www.schst.net/XJConf"3 xmlns:math="http://www.schst.net/XJConf/Math">4 <map>5 <number name="foo">6 <math:add>7 <int>13</int><int>34</int>8 </math:add>9 </number>10 <number name="bar">11 <math:add>12 <int>104</int><double>34.5</double>13 </math:add>14 </number>15 </map>16 <array>17 <math:add>18 <int>104</int><double>34.5</double>19 </math:add>20 <math:add>21 <int>123</int><double>34.5321</double><double>-4</double>22 </math:add>23 </array>2 xmlns:xj="http://xjconf.net/XJConf" 3 xmlns:math="http://www.schst.net/XJConf/Math"> 4 <map> 5 <number name="foo"> 6 <math:add> 7 <int>13</int><int>34</int> 8 </math:add> 9 </number> 10 <number name="bar"> 11 <math:add> 12 <int>104</int><double>34.5</double> 13 </math:add> 14 </number> 15 </map> 16 <array> 17 <math:add> 18 <int>104</int><double>34.5</double> 19 </math:add> 20 <math:add> 21 <int>123</int><double>34.5321</double><double>-4</double> 22 </math:add> 23 </array> 24 24 </xj:configuration> trunk/examples/xml/test-xinclude-included.xml
r17 r96 1 <xj:configuration xmlns:xj="http:// www.schst.net/XJConf">2 <color red="100" green="50" blue="20">My color</color>1 <xj:configuration xmlns:xj="http://xjconf.net/XJConf"> 2 <color red="100" green="50" blue="20">My color</color> 3 3 </xj:configuration> trunk/examples/xml/test-xinclude.xml
r17 r96 1 1 <xj:configuration 2 xmlns:xj="http:// www.schst.net/XJConf"2 xmlns:xj="http://xjconf.net/XJConf" 3 3 xmlns:xi="http://www.w3.org/2001/XInclude"> 4 4 5 <int id="zahl">453</int>6 <bool id="bool">true</bool>5 <int id="zahl">453</int> 6 <bool id="bool">true</bool> 7 7 8 <xi:include href="test-xinclude-included.xml"/>8 <xi:include href="test-xinclude-included.xml"/> 9 9 </xj:configuration>
