diff options
Diffstat (limited to 'src/cppunit')
| -rw-r--r-- | src/cppunit/XmlDocument.cpp | 21 | ||||
| -rw-r--r-- | src/cppunit/XmlOutputter.cpp | 7 |
2 files changed, 27 insertions, 1 deletions
diff --git a/src/cppunit/XmlDocument.cpp b/src/cppunit/XmlDocument.cpp index 486c263..8eaa0a7 100644 --- a/src/cppunit/XmlDocument.cpp +++ b/src/cppunit/XmlDocument.cpp @@ -9,6 +9,7 @@ XmlDocument::XmlDocument( const std::string &encoding, const std::string &styleSheet ) : m_rootElement( new XmlElement( "DummyRoot" ) ) , m_styleSheet( styleSheet ) + , m_standalone( true ) { setEncoding( encoding ); } @@ -49,6 +50,20 @@ XmlDocument::setStyleSheet( const std::string &styleSheet ) } +bool +XmlDocument::standalone() const +{ + return m_standalone; +} + + +void +XmlDocument::setStandalone( bool standalone ) +{ + m_standalone = standalone; +} + + void XmlDocument::setRootElement( XmlElement *rootElement ) { @@ -71,7 +86,11 @@ std::string XmlDocument::toString() const { std::string asString = "<?xml version=\"1.0\" " - "encoding='" + m_encoding + "' standalone='yes' ?>\n"; + "encoding='" + m_encoding + "'"; + if ( m_standalone ) + asString += " standalone='yes'"; + + asString += " ?>\n"; if ( !m_styleSheet.empty() ) asString += "<?xml-stylesheet type=\"text/xsl\" href=\"" + m_styleSheet + "\"?>\n"; diff --git a/src/cppunit/XmlOutputter.cpp b/src/cppunit/XmlOutputter.cpp index cc9f175..c605e33 100644 --- a/src/cppunit/XmlOutputter.cpp +++ b/src/cppunit/XmlOutputter.cpp @@ -59,6 +59,13 @@ XmlOutputter::setStyleSheet( const std::string &styleSheet ) void +XmlOutputter::setStandalone( bool standalone ) +{ + m_xml->setStandalone( standalone ); +} + + +void XmlOutputter::setRootNode() { XmlElement *rootNode = new XmlElement( "TestRun" ); |
