Valid XHTML in template file
Kralidis,Tom [Burlington]
Tom.Kralidis at EC.GC.CA
Tue Aug 15 08:54:13 PDT 2006
I guess this spawns a grander question w.r.t. what type of HTML
MapServer code (for templated output) supports? Should we be moving
towards XHTML (Strict/Loose/Transitional,...).
..Tom
> -----Original Message-----
> From: UMN MapServer Users List
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Steve Lime
> Sent: 15 August, 2006 11:51 AM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] Valid XHTML in template file
>
> Those substitutions are *very* old, well before XHTML. You
> could hack the source to have those substitutions output
> checked="checked" instead of what currently is output- it's 1
> line of code per element type. The alternative would be to
> not use them at all and use javascript to preserve state.
>
> Sorry (this could easily be fixed in new versions though if
> you could file a quick bug)...
>
> Steve
>
>
> >>> "Thy, Kristian" <Kristian.Thy at ATKINSGLOBAL.COM> 8/15/2006 10:23:45
> AM >>>
> Hi List,
>
> I'm trying to make a template file that's valid XHTML. All is
> well and fine, except for the zoom direction. I have three
> radio buttons, "zoom in", "pan" and "zoom out". The template
> mechanism gives me the [zoomdir_-1|0|1_check|select]
> substitution that is then set as [zoomdir_1_check],
> [zoomdir_0_check] and [zoomdir_-1_check] respectively.
>
> Problem is that in order to make valid XHTML Transitional,
> the checked element needs to have the attribute
> checked="checked", while the others need to have no such
> attribute. If I make the three radio buttons like
> this:
>
> <input type="radio" name="zoomdir" value="1"
> [zoomdir_1_check] />
> <input type="radio" name="zoomdir" value="0"
> [zoomdir_0_check] />
> <input type="radio" name="zoomdir" value="-1"
> [zoomdir_-1_check]
> />
>
> the selected element will get the shorthand attribute checked
> (with no value set) which is valid for HTML4. If I do it the
> XHTML way:
>
> <input type="radio" name="zoomdir" value="1"
> checked="[zoomdir_1_check]" />
> <input type="radio" name="zoomdir" value="0"
> checked="[zoomdir_0_check]" />
> <input type="radio" name="zoomdir" value="-1"
> checked="[zoomdir_-1_check]" />
>
> the selected zoom direction will get checked="checked", which
> is good, but the other two will get checked="", which is
> illegal. Is there no way to create valid XHTML like this with
> the template file mechanism?
>
>
> thanks in advance,
> Kristian Thy
> Atkins Denmark
>
>
> This email and any attached files are confidential and
> copyright protected. If you are not the addressee, any
> dissemination of this communication is strictly prohibited.
> Unless otherwise expressly agreed in writing, nothing stated
> in this communication shall be legally binding.
>
More information about the MapServer-users
mailing list