Changeset 111


Ignore:
Timestamp:
06/21/10 15:06:43 (14 years ago)
Author:
hozdoba
Message:

Insensibitilité à la casse des noms de balises et d'attributs (ex : field_definition <=> FieLd_DefiNition, id <=> ID, etc .) .
Traitement sur les attributs, les chaînes de caractÚres sont désormais dépourvues d'espaces en début et fin.

Location:
XMLIO_V2/dev/dev_rv/src/XMLIO
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/XMLIO/attribut.hpp

    r108 r111  
    1616         { /* Ne rien faire de plus */} 
    1717 
    18          istream& operator>> (std::string& s) {s.assign(this->iss.str()); return (this->iss);} 
     18         istream& operator>> (std::string& s) 
     19         {s.assign(this->iss.str()); return (this->iss);} 
    1920         istream& operator>> (int& s) { return (iss>>s); } 
    2021         istream& operator>> (bool& s) 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/main_cpp.cpp

    r110 r111  
    1111   try 
    1212   { 
    13       //string file("/local/XMLIOSERVER_DEV/dev_rv/test/iodef_test.xml"); 
    14       string file("/local/XMLIOSERVER_DEV/dev_rv/iodef_test.xml"); 
     13      string file("/local/XMLIOSERVER_DEV/dev_rv/test/iodef_test.xml"); 
     14      //string file("/local/XMLIOSERVER_DEV/dev_rv/iodef_test.xml"); 
    1515 
    1616      ifstream istr( file.c_str() , ifstream::in ); 
     
    2929      Context::ShowTree(std::clog); 
    3030 
    31       /*std::clog << "Nombre de Contexts listés : " << Context::GetCurrentListObject().getSize() << " contre 1 attendus."<< std::endl; 
    32       std::clog << "Nombre de FieldGroups listés : " << FieldGroup::GetCurrentListObject().getSize() << " contre 5 attendus."<< std::endl; 
    33       std::clog << "Description du champs votkeavt : " << Field::GetObject("votkeavt").axis_ref << " contre \"Vertical Eddy Diffusivity\" attendus."<< std::endl;*/ 
    34  
    3531   } 
    3632   catch(const Exception &exc) 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_c_interface.cpp

    r98 r111  
    1 /* 
     1/*using namespace XMLIOSERVER; 
     2using namespace XMLIOSERVER::XML; 
     3using namespace std; 
     4 
    25extern "C" 
    36{ // Début du code C 
    4  
    5    using namespace XMLIOSERVER; 
    6    using namespace XMLIOSERVER::XML; 
    7    using namespace std; 
    87    
    98   typedef void *XMLIOhandle; 
     
    1110   // VIDE TEMPORAIREMENT 
    1211    
    13 } 
    14 */ 
     12}*/ 
     13 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_xml_node.hpp

    r109 r111  
    1111#include <Poco/DOM/AutoPtr.h> 
    1212 
    13 // Entêtes Poco SAX 
     13// Entêtes Poco SAX. 
    1414#include <Poco/SAX/InputSource.h> 
    1515 
    16 // Utilisation de la STL 
     16// Utilisation de la STL. 
    1717using std::string; 
    1818 
     
    2525using std::ifstream; 
    2626 
    27 // Utilisation de la biliothÚque POCO 
     27// Utilisation de la biliothÚque POCO. 
    2828using Poco::XML::DOMParser; 
    2929using Poco::XML::InputSource; 
     
    6464                  // ... et à pour valeur la chaîne rootName. 
    6565                  node.pDoc = parser.parse(&src); 
    66                   if (!(node.pDoc->documentElement()->nodeName().compare(_rootName))) 
    67                   { node.setCNode(node.pDoc->documentElement()); } 
    68                   else 
    69                      throw XMLParsingException("L'élément racine doit avoir pour valeur <" + _rootName + "> (\"" + (node.pDoc->documentElement()->nodeName()) + "\" lue)"); 
     66                  node.setCNode(node.pDoc->documentElement()); 
     67                  if (node.getElementName().compare(_rootName) != 0) 
     68                     throw XMLParsingException("L'élément racine doit avoir pour valeur <" + _rootName + "> (\"" + node.getElementName() + "\" lue)"); 
    7069               } 
    7170               else 
     
    7574            } 
    7675 
    77             string getElementName(void) const {return (this->getCNode()->nodeName());} 
     76            string getElementName(void) const 
     77            { string _str(this->getCNode()->nodeName()); return (_toLower(_str)); } 
    7878 
    7979            bool goToNextElement(void) 
     
    127127 
    128128               for(unsigned int i = 0; i< map->length(); i++) 
    129                   attributes[map->item(i)->nodeName()] = map->item(i)->nodeValue(); 
     129               { 
     130                  string _str(map->item(i)->nodeName()); 
     131                  size_t d = map->item(i)->nodeValue().find_first_not_of (' '); 
     132                  size_t f = map->item(i)->nodeValue().find_last_not_of (' '); 
     133                  attributes[_toLower(_str)] = map->item(i)->nodeValue().substr(d,f-d+1); 
     134               } 
    130135 
    131136               return (true); 
     
    143148 
    144149         private : 
     150 
     151            string& _toLower(string& _str) const 
     152            { 
     153               for (unsigned int i = 0; i < _str.size(); i++) 
     154                  _str[i] = tolower(_str[i]); 
     155               return (_str); 
     156            } 
     157 
    145158            AutoPtr<Document> pDoc; 
    146159            Node*  cNode; 
Note: See TracChangeset for help on using the changeset viewer.