Changeset 96

Show
Ignore:
Timestamp:
03/29/07 14:26:25 (1 year ago)
Author:
mikey
Message:

use new namespace http://xjconf.net/XJConf
removed tabs
corrected indentions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/XJConf/XmlParser.php

    r94 r96  
    5959     * @var  string 
    6060     */ 
    61     private $myNamespace = 'http://www.schst.net/XJConf'; 
     61    private $myNamespace = 'http://xjconf.net/XJConf'; 
    6262    /** 
    6363     * stack of currently opened files 
     
    152152                    $attributes   = array(); 
    153153                    if (TRUE == $reader->hasAttributes) { 
    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                            } 
     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                    } 
    162162 
    163163                    $this->startElement($nameSpaceURI, $elementName, $attributes); 
     
    307307            $result = $this->extensions[$namespaceURI]->endElement($this, $tag); 
    308308            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                } 
    320320            } 
    321321        // last tag before returning to root 
    322322        } elseif (1 == $this->depth) { 
    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); 
     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); 
    329329        } 
    330330    } 
     
    341341    { 
    342342        if (count($this->tagStack) == 0) { 
    343                return; 
     343            return; 
    344344        } 
    345345 
  • trunk/examples/xml/test-classloader.xml

    r46 r96  
    11<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 /> 
    66</xj:configuration> 
  • trunk/examples/xml/test-extension.xml

    r34 r96  
    11<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> 
    2424</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> 
    33</xj:configuration> 
  • trunk/examples/xml/test-xinclude.xml

    r17 r96  
    11<xj:configuration 
    2     xmlns:xj="http://www.schst.net/XJConf" 
     2    xmlns:xj="http://xjconf.net/XJConf" 
    33    xmlns:xi="http://www.w3.org/2001/XInclude"> 
    44 
    5     <int id="zahl">453</int> 
    6        <bool id="bool">true</bool> 
     5  <int id="zahl">453</int> 
     6  <bool id="bool">true</bool> 
    77 
    8     <xi:include href="test-xinclude-included.xml"/> 
     8  <xi:include href="test-xinclude-included.xml"/> 
    99</xj:configuration>