Ignore:
Timestamp:
12/06/17 18:36:26 (6 years ago)
Author:
ymipsl
Message:

Fix : when arithmetic field expression is defined, other xml node are now taking into account.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/xml_node.cpp

    r591 r1363  
    11#include "xml_node.hpp" 
     2#include <boost/algorithm/string.hpp> 
    23 
    34namespace xios 
     
    2627         bool retvalue = false; 
    2728         for(rapidxml::xml_node<char> * nextElement = this->node->next_sibling(); 
    28                                       ; nextElement = this->node->next_sibling()) 
     29                                      ; nextElement = nextElement->next_sibling()) 
    2930         { 
    3031            if (nextElement == NULL) break; 
     
    6768         return (!retvalue); 
    6869      } 
    69  
     70/* 
    7071      bool CXMLNode::getContent(StdString & content) 
    7172      { 
     
    7374         content.assign(this->node->value(), this->node->value_size()); 
    7475         return (true); 
     76      } 
     77*/ 
     78      bool CXMLNode::getContent(StdString & content) 
     79      { 
     80         content="" ; 
     81         bool retvalue = false; 
     82          
     83         rapidxml::xml_node<char> * nextElement = this->node->first_node(); 
     84         while (nextElement != NULL) 
     85         { 
     86             if (nextElement->type() == rapidxml::node_data) content=content+std::string(nextElement->value(),nextElement->value_size()); 
     87             nextElement = nextElement->next_sibling();  
     88         } 
     89         boost::algorithm::replace_all(content,"\n"," ") ; 
     90         boost::algorithm::trim(content) ; 
     91         if (content.size()==0) return false ; 
     92         else return true ; 
    7593      } 
    7694 
Note: See TracChangeset for help on using the changeset viewer.