[GRASS-dev] [GRASS GIS] #1791: gui modeler: cannot load file with r.mapcalc expression containing '&&' operator

GRASS GIS trac at osgeo.org
Tue Dec 3 06:38:46 PST 2013


#1791: gui modeler: cannot load file with r.mapcalc expression containing '&&'
operator
--------------------------+-------------------------------------------------
  Reporter:  mlennert     |       Owner:  grass-dev@…              
      Type:  defect       |      Status:  closed                   
  Priority:  normal       |   Milestone:  7.0.0                    
 Component:  wxGUI        |     Version:  svn-trunk                
Resolution:  fixed        |    Keywords:  modeler r.mapcalc        
  Platform:  Unspecified  |         Cpu:  Unspecified              
--------------------------+-------------------------------------------------

Comment(by wenzeslaus):

 Replying to [comment:3 mlennert]:
 >
 > It works here when you create a new model file. One which already
 contains '&&' still cannot be loaded (which is logical as your change
 concerns writing the file), but I guess that this cannot be easily solved
 and that your solution is good enough. Any existing model files still have
 to be handled manually, but as soon as you save them again the issue is
 solved.
 >
 Yes of course, I forgot to mention. It now writes a well-formed XML and
 also reads well-formed XML (as before).

 So, if you have existing `.gxm` file you need to load it with error and
 than fix the damaged expressions or other parameters, or you can open the
 `.gxm` in text editor and replace (probably all) occurrences of `&&` by
 `&&`. Doing so, you will create a well-formed XML from your old
 XML (e.g. Gedit highlights `&&` as invalid syntax). Example file part:

 {{{
 <task name="r.mapcalc">
     <parameter name="expression">
         <value>elevation && aspect</value>
     </parameter>
 </task>
 }}}

 Looking at the
 [http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
 list at Wikipedia], other entities were already handled correctly (`<` and
 `>`) or are probably not an issue (`"` and `'`) for our case.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/1791#comment:4>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list