Changeset 1019

Show
Ignore:
Timestamp:
11/09/07 18:16:15 (8 months ago)
Author:
mikey
Message:

added new getVersion() method which returns the xml version that will be used by the writer

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/xml/stubAbstractXMLStreamWriter.php

    r1018 r1019  
    1717{ 
    1818    /** 
     19     * XML version 
     20     * 
     21     * @var  string 
     22     */ 
     23    protected $xmlVersion; 
     24    /** 
    1925     * encoding used by the writer 
    2026     * 
     
    2834     */ 
    2935    protected $features = array(); 
     36 
     37    /** 
     38     * returns the xml version used by the writer 
     39     * 
     40     * @return  string 
     41     */ 
     42    public function getVersion() 
     43    { 
     44        return $this->xmlVersion; 
     45    } 
    3046 
    3147    /** 
  • trunk/src/main/php/net/stubbles/xml/stubDomXMLStreamWriter.php

    r1018 r1019  
    3939     */ 
    4040    protected $elementStack = array(); 
    41     /** 
    42      * XML version 
    43      * 
    44      * @var string 
    45      */ 
    46     protected $xmlVersion; 
    4741 
    4842    /** 
  • trunk/src/main/php/net/stubbles/xml/stubLibXmlXMLStreamWriter.php

    r1018 r1019  
    3131     */ 
    3232    protected $writer; 
    33     /** 
    34      * XML version 
    35      * 
    36      * @var string 
    37      */ 
    38     protected $xmlVersion; 
    3933 
    4034    /** 
  • trunk/src/main/php/net/stubbles/xml/stubXMLStreamWriter.php

    r1018 r1019  
    3838     */ 
    3939    #public function __construct($xmlVersion = '1.0', $encoding = 'UTF-8'); 
     40 
     41    /** 
     42     * returns the xml version used by the writer 
     43     * 
     44     * @return  string 
     45     */ 
     46    public function getVersion(); 
    4047 
    4148    /** 
  • trunk/src/test/php/net/stubbles/xml/stubDomXMLStreamWriterTestCase.php

    r1018 r1019  
    2424        $writer = new stubDomXMLStreamWriter(); 
    2525        $this->assertEqual('<?xml version="1.0" encoding="UTF-8"?>', $writer->asXML()); 
     26        $this->assertEqual($writer->getVersion(), '1.0'); 
    2627        $this->assertEqual($writer->getEncoding(), 'UTF-8'); 
    27         $writer = new stubDomXMLStreamWriter('1.0', 'ISO-8859-1'); 
     28        $writer = new stubDomXMLStreamWriter('1.1', 'ISO-8859-1'); 
     29        $this->assertEqual($writer->getVersion(), '1.1'); 
    2830        $this->assertEqual($writer->getEncoding(), 'ISO-8859-1'); 
    2931    } 
  • trunk/src/test/php/net/stubbles/xml/stubLibXmlXMLStreamWriterTestCase.php

    r1018 r1019  
    2424        $writer = new stubLibXmlXMLStreamWriter(); 
    2525        $this->assertEqual('<?xml version="1.0" encoding="UTF-8"?>', $writer->asXML()); 
     26        $this->assertEqual($writer->getVersion(), '1.0'); 
    2627        $this->assertEqual($writer->getEncoding(), 'UTF-8'); 
    27         $writer = new stubLibXmlXMLStreamWriter('1.0', 'ISO-8859-1'); 
     28        $writer = new stubLibXmlXMLStreamWriter('1.1', 'ISO-8859-1'); 
     29        $this->assertEqual($writer->getVersion(), '1.1'); 
    2830        $this->assertEqual($writer->getEncoding(), 'ISO-8859-1'); 
    2931    }