diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2004-09-01 19:17:36 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2004-09-01 19:17:36 +0000 |
| commit | 87051183eea0f573bd4f3521446d7eb4da4622be (patch) | |
| tree | e03ebde8d15fecd5e8eecf4986d088fc0708bd67 /src/cppunit | |
| parent | 4a003a878cfff870c7b2417c824042af0af60d59 (diff) | |
| download | cppunit-87051183eea0f573bd4f3521446d7eb4da4622be.tar.gz | |
Include/cppunit/XmlOutputter.
include/cppunit/XmlOutputter.h:
* include/cppunit/tools/XmlDocument.h
* src/cppunit/XmlDocument.cpp:
* src/cppunit/XmlOutputter.cpp: integrated patch #997006 from Akos Maroy.
This patch makes the 'standalone' attribute in XML header optional.
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" ); |
