On Wed, 26 Sep 2001, Mark Abbott wrote:
> Date: Wed, 26 Sep 2001 10:43:51 -0700
> From: Mark Abbott <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: %=x% expression syntax bug in XML jsp?
>
> Hi Craig -
>
> I'm curious whether the expert group has discussed what
> might be done in the future about this unfortunate
> aspect of JSP. In what I would think would be a
> really common case in the future, where one wants to
> design an app using clean, readable, and purely XML
> templates (perhaps XHTML for example), but editing by
> hand rather than with some JSP savvy tool, the choices
> are:
>
> > * Create a custom tag <foo:text> which just dumps out the
> > corresponding <text> tag
>
> Wrapping all the tags in every markup of interest is impractical
>
> > * Write the XML syntax in the way that the JSP compiler expects:
> > <jsp:text><![CDATA[<text y="10" x="]]>
> > <jsp:expression>xpos</jsp:expression>
> > <jsp:text><![CDATA[">test</test></jsp:text>
>
> This is an unreadable mess, especially considering scaling
> up to a substantial size of template
>
> > * Use the JSP syntax, where <%= %> expressions *are* recognized
> > everywhere.
>
> This is not XML any more
>
>
> Cheers - Mark
There was *considerable* discussion about the details of the XML syntax.
On this particular point, my take-away from the results was no particular
desire to change a fundamental assumption from the very early days of JSP
-- that JSP is totally agnostic to the syntax and semantics of the
template text. To do as you suggest would require the JSP compiler to
"understand" in some fashion that the template text it is processing is
really element+attribute oriented (as XML and HTML are), so that it could
apply this particular transformation the way you want.
Also, the design center for the XML syntax was definitely around automatic
generation from tools, rather than hand-editing. And it shows in use
cases like this one.
It's too late to do anything in a JSP 1.2 time frame (since the spec just
went final), but it would certainly be worthwhile to log your suggestion
to the spec feedback address for consideration in a future version:
[EMAIL PROTECTED]
Craig