David Zaebst
-
2008-06-26
- summary: Option to remove the header --> Option to remove the XML header
Hi,
All XML docs have the header at the top:
<?xml version="1.0" encoding="UTF-8"?>
Which usually works out quite well. However, when trying to merge xml files, this header gets in the way.
Can an option be added to suppress the header?
This might not be the best design, but it's possible to have XmlDocument.cpp test the value passed for the encode string. If the string is 'noencode' ( or possibly 'noheader' ), it would not print the header.
-- In XmlDocument.cpp --
XmlDocument::toString() const
{
std::string noencode = "noencode";
if ( m_encoding == noencode )
{
std::string asString = "";
return asString;
}
Thanks,
Dave