From 8ff3e0fed53fb64b27b01ab69acee60fbf4e4013 Mon Sep 17 00:00:00 2001 From: Patrick Benavoli Date: Thu, 24 Jul 2014 18:46:25 +0200 Subject: Cleaned up XML export feature BZ: 209937 This patch solves 1 issue regarding XML export feature: - ParameterMgr.cpp::exportElementToXMLString(): This method was receiving a useless bValidateWithSchema argument. Indeed, elements in memory are necessarily valid (unlike documents coming from external sources). Change-Id: I55bf84c8ff53c37c9fc55e60f7f64e8776a43dc7 Signed-off-by: Patrick Benavoli --- parameter/ParameterMgr.cpp | 12 +++++++----- parameter/ParameterMgr.h | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index a1f2087..e11b1ad 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -1112,7 +1112,8 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listCriteriaCommman // Get Root element where to export from const CSelectionCriteriaDefinition* pSelectionCriteriaDefinition = getConstSelectionCriteria()->getSelectionCriteriaDefinition(); - if (!exportElementToXMLString(pSelectionCriteriaDefinition, "SelectionCriteria", false, strResult)) { + if (!exportElementToXMLString(pSelectionCriteriaDefinition, "SelectionCriteria", + strResult)) { return CCommandHandler::EFailed; } @@ -1676,7 +1677,7 @@ CParameterMgr::CCommandHandler::CommandStatus // Get Root element where to export from const CSystemClass* pSystemClass = getSystemClass(); - if (!exportElementToXMLString(pSystemClass, pSystemClass->getKind(), false, strResult)) { + if (!exportElementToXMLString(pSystemClass, pSystemClass->getKind(), strResult)) { return CCommandHandler::EFailed; } @@ -2612,15 +2613,16 @@ void CParameterMgr::doApplyConfigurations(bool bForce) } // Export to XML string -bool CParameterMgr::exportElementToXMLString(const IXmlSource *pXmlSource, const string& strRootElementType, bool bValidateWithSchema, string& strResult) const +bool CParameterMgr::exportElementToXMLString(const IXmlSource* pXmlSource, + const string& strRootElementType, + string& strResult) const { string strError; CXmlSerializingContext xmlSerializingContext(strError); // Use a doc source by loading data from instantiated Configurable Domains - CXmlMemoryDocSource memorySource(pXmlSource, strRootElementType, - bValidateWithSchema); + CXmlMemoryDocSource memorySource(pXmlSource, strRootElementType, false); // Use a doc sink that write the doc data in a string CXmlStringDocSink stringSink(strResult); diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index 03a1e92..6a3ecb8 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -344,12 +344,13 @@ public: * * @param[in] pXmlSource The source element to export * @param[in] strRootElementType The XML root element name of the exported instance document - * @param[in] bValidateWithSchema true if source XML document requires validation against schema * @param[out] strResult contains the xml description or the error description in case false is returned * * @return true for success, false if any error occurs during the creation of the xml description (validation or encoding) */ - bool exportElementToXMLString(const IXmlSource* pXmlSource, const std::string& strRootElementType, bool bValidateWithSchema, std::string& strResult) const; + bool exportElementToXMLString(const IXmlSource* pXmlSource, + const std::string& strRootElementType, + std::string& strResult) const; // CElement virtual std::string getKind() const; -- cgit v1.1