jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Stirling" <sstirl...@mediaone.net>
Subject RE: taglib roadmap and practices
Date Sat, 23 Dec 2000 17:31:20 GMT
> -----Original Message-----
> From: glenn@zathras.earthdome.org [mailto:glenn@zathras.earthdome.org]On
> Behalf Of Glenn Nielsen
>
> Scott Stirling wrote:
> > Take 1 is going to be a lot easier for anyone to code by hand.  It also
> > follows the idioms of HTML more closely (which I think is a
> good thing; even
> > with XHTML, the nice thing is that HTML doesn't need name-space
> prefixes).
> > Take 2 is much more XML oriented, and would be a nightmare to code with
> > anything other than a tool that did it all via a wizard of some
> sort.  So
> > one question I have is whether an approach like this will alienate or
> > handicap the users who code this stuff "by hand" in an editor.
> >
>
> HTML really is XML, which by default is in the HTML namespace and
> is not required to be well formed.

Fooled me then.  I thought XML had to be well-formed or it wasn't XML.  On
the other hand, I thought XML docs were not required to be _valid_.  But
maybe I'm misunderstanding your syntax.  The way I read that sentence is
that you're saying XML is in the HTML namespace and XML doesn't have to be
well-formed.

See this from the XHTML 1.0 spec:

"4. Differences with HTML 4
Due to the fact that XHTML is an XML application, certain practices that
were perfectly legal in SGML-based HTML 4 [HTML] must be changed.

4.1 Documents must be well-formed
Well-formedness is a new concept introduced by [XML]. Essentially this means
that all elements must either have closing tags or be written in a special
form (as described below), and that all the elements must nest."

> HTML tags use both attributes and nested elements, examples of nested
> elments are the <TD> which is nested inside a <TR> which is nested inside
> a <TABLE> tag.

FYI, they're both (HTML and XML) "really" SGML, which also has nested
elements and attributes.  But answer me this -- when you're coding HTML, are
you coding SGML?  Are you coding XML?  Pedantically, technically, yes.
Practically, no.

The logic behind most tags with body content in HTML is clear -- <TABLE>,
<BODY>, <H1>, etc. mark up and provide rendering information to the user
agent for the enclosed content.  Tags like <HTML>, <STYLE> and <HEAD>
provide more abstract information having nothing to do with rendering.
Attributes usually provide configuration information.  What we've seen being
proposed in this thread is that any dynamic configuration information in JSP
(dynamic being the operative word, since HTML doesn't have this capability)
should be enclosed as body-content in a nested tag.  I'm saying that's
XML-ifying, while for the people who actually code JSPs by hand, we should
look for ways to HTML-ify JSP (without sacrificing the ability to have a
valid XML translation of every JSP).

> I see JSP custom tags using both attributes and nested elements.

So do I.  The discussion we were having was about the practical difficulties
of dynamic assignment of values to attributes in JSP custom tags.  More
specifically it was about whether and when configuration information for a
tag should be body content (even if it's of a nested tag), or attribute
value.  You seem to think we were discussing whether JSP should have
attributes to the exclusion of nested elements, or vice-versa.  I didn't see
anyone suggesting that.

As for the rest of what follows, I agree.  I use vi for everything, which is
why I'm really annoyed with writing opening and closing tags for things that
could just as well be attributes as far as I'm concerned.

Scott

> A custom tag value that does not need to be set dynamically is a
> great candidate
> to be an attribute.
>
> Something that would always be dynamic is a candidate for a nested tag or
> getting set by being the content of a tag body.
>
> Some tags could benefit from being able to set values using both
> an attribute
> and nested tags/body content.  Then you can use the method that best fits
> your use of the tag.  Or set the default value using the
> attribute, but still
> have the ability to change it dynamically using the nested
> tag/body content.
>
> This would work well for both people like me who use vi when I
> have to edit
> JSP pages and for those using web publishing tools.
>
> Here is a modified examples of the mail tag above, notice how the default
> subject is set using an attribute but can still be dynamically set using
> a nested tag.
>
> <mail:create smtp-server="accept.spam.net"
> from="spammer@fake.add" subject="Spam">
>   <mail:to><req:parameter name="to"/></mail:to>
>   <req:existsparameter name="subject">
>     <mail:subject><req:parameter name="subject"/></mail:subject>
>   </req:existsparameter>
>   <mail:body>
>     Thank you for your spam request.
>
>     <req:parameter name="body"/>
>   </mail:body>
>   <%-- Now send the mail --%>
>   <mail:send/>
> </mail:create>
>
> Regards,
>
> Glenn


Mime
View raw message