[mapserver-users] Map file xsl transformation and regular expressions

Alan Boudreault aboudreault at mapgears.com
Mon Mar 22 12:04:09 EDT 2010


Alexandre, could you test the new xsl file  and see if your two issues have 
been fixed. You can get it via: 
http://trac.osgeo.org/mapserver/browser/trunk/mapserver/xmlmapfile/mapfile.xsl?format=raw

I did a quick fix to integrate it in MS 5.6.3, which is supposed to be 
released today.

expression/filter examples:
<expression type="CONSTANT">583</expression> or <expression>583</expression> 
will be quoted.
<expression type="REGEX">/.../</expression> and 
<expression type="MSEXPR">(...)</expression> will not be quoted.

symbol examples:
<symbol type="NAME">star.gif</symbol> will be quoted
<symbol type="ID">32</symbol> will not be quoted

Thanks,
Alan

On March 19, 2010 02:59:17 pm Alexandre Soares wrote:
> The symbol attribute (which does not get quoted by default) causes a
>  problem if the value references a stmbol's name. I think it could also
>  benefit from your fix.
> 
> Thank you!
> On Fri, Mar 19, 2010 at 2:49 PM, Alan Boudreault
> 
> <aboudreault at mapgears.com>wrote:
> > Alexandre, you are right, if the expression is an regular expression, it
> > shouldn't be quoted. I think the only solution would be to add an
> > attribute in
> > the xml schema, that will specify if the expression is an regular
> > expression
> > of not. Something like:
> >
> > <expression regex="ON"></expression>
> >
> > In this case, the xsl transformation would not quote it. I take a note on
> > that
> > and should fix this in the next few days.
> >
> > Thanks for reporting!
> > Alan
> >
> > On March 19, 2010 02:21:45 pm Alexandre Soares wrote:
> > > Hi,
> > >
> > > When I transform my xml map file to a map file, my expressions that
> >
> > contain
> >
> > > a regular expression (the same is true for filters) are rendered with
> > >  double quotes (because the stylesheet has the quote="1" param for
> > > those templates).
> > >
> > > Is there an intended way to achieve this? I know I could modify the
> > > stylesheet to not quote those elements and then quote-wrap my value if
> > > I need them (in case of string comparison).
> > >
> > > Thank you!
> >
> > --
> > Alan Boudreault
> > Mapgears
> > http://www.mapgears.com
> 

-- 
Alan Boudreault
Mapgears
http://www.mapgears.com


More information about the mapserver-users mailing list