Opened 20 years ago

Last modified 15 years ago

#784 new defect

error "Malformed template name" at nquery with template statement in layer section

Reported by: andreas.maul@… Owned by: sdlime
Priority: high Milestone: 6.0 release
Component: MapServer CGI Version: 4.0
Severity: normal Keywords:
Cc: bfraser@…

Description (last modified by sdlime)

I have defined some layers in my map file with the same name (to be shown 
simultaneously) but with different template names. These layers represent bore 
hole locations in different counties in Germany.

If I do a query for bore hole data of a (single) layer with mapserver 4.0 (cgi 
application, mode=nquery) with a template defined in the layer section I get 
often correct results but sometimes following error messages:

...
Content-type: text/html msReturnPage(): Web application error. Malformed 
template name. 
msyyparse(): Expression parser error. parse error 
msyyparse(): Expression parser error. parse error 
...

together with regular results. If I specify the template object in all classes 
of the layer, the mapserver nquery is done correctly. Appended is a code 
snippet from my map file:

... 
more Layers
...
#
LAYER
  GROUP "wells"
  NAME "BO"
  METADATA
      LEGEND_ORDER "0"
  END
  DATA "shapes\bo_ni"
  TYPE POINT
  STATUS OFF
  TOLERANCE 7
  TOLERANCEUNITS PIXELS
  MAXSCALE 200000
  SYMBOLSCALE 100000
  CLASSITEM "DEPTH"
  CLASS
    NAME "Depth: < 5m"
    EXPRESSION ([DEPTH] <= 5.)
    STYLE
      SYMBOL circle
      COLOR 0 255 0 
      OUTLINECOLOR 0 0 0 
      SIZE 8
      MINSIZE 4
      MAXSIZE 8
    END
#     TEMPLATE t_bo_ni.htm  # application works correctly if commented out
   END
   CLASS
       NAME "Depth: 5 to 20m"
       EXPRESSION ([DEPTH] > 5. AND [DEPTH] <= 20.)
       STYLE
         SYMBOL circle
         COLOR 51 204 255 
         OUTLINECOLOR 0 0 0  
         SIZE 8
         MINSIZE 4
         MAXSIZE 8
       END
 #       TEMPLATE t_bo_ni.htm  # see above
   END
   CLASS
       NAME "Depth: 20 to 50m"
       EXPRESSION ([DEPTH] > 20. AND [DEPTH] <= 50.)
       STYLE
         SYMBOL circle
         COLOR 255 102 255  
         OUTLINECOLOR 0 0 0 
         SIZE 8
         MINSIZE 4
         MAXSIZE 8
       END
 #       TEMPLATE t_bo_ni.htm # see above
   END
   CLASS
       NAME "Depth: 50 to 100m"
       EXPRESSION ([DEPTH] > 50. AND [DEPTH] <= 100.)
       STYLE
         SYMBOL circle
         COLOR 255 0 0 
         OUTLINECOLOR 0 0 0 
         SIZE 8
         MINSIZE 4
         MAXSIZE 8
       END
 #       TEMPLATE t_bo_ni.htm # see above
   END
   CLASS
       NAME "Depth: > 100m"
       EXPRESSION ([DEPTH] > 100.)
       STYLE
         SYMBOL circle
         COLOR 255 204 0
         OUTLINECOLOR 0 0 0 
         SIZE 8
         MINSIZE 4
         MAXSIZE 8
       END
  #      TEMPLATE t_bo_ni.htm # see above
   END
   TEMPLATE t_bo_ni.htm      # sometimes nquery results in error 
message "Malformed template name." 
END   # layer Wells (Lower Saxony, Germany)
#
...

Change History (5)

comment:1 by sdlime, 20 years ago

Try using .html instead of .htm and see if that works, that is rename the 
template
.

Steve

comment:2 by andreas.maul@…, 20 years ago

Renaming the template to "t_bo_ni.html" doesn't help. Same error as above.
Regards,
Andreas 

comment:3 by bfraser, 15 years ago

I ran into the same problem on a Windows machine running Mapserver v5.2.1. I had used ".HTML" (uppercase) as the header and footer template name extension. Changing to lowercase (".html") solved the problem.

Brent Fraser

comment:4 by bfraser, 15 years ago

Cc: bfraser@… added

comment:5 by sdlime, 15 years ago

Description: modified (diff)
Milestone: 6.0 release

Argh. I just need a case insensitive REGEX to use against template names. See mapserver.h for the current definition.

Steve

Note: See TracTickets for help on using tickets.