You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Armin Pfarr <ap...@vipsurf.de> on 2000/05/10 09:27:33 UTC

Including Resources into a taglib

Hi,

I'm developing a JSP-tag that renders the structure of an XML-instance as a
expandable/collapsable tree similar to the windows filemanager. It works
fine and doesn't even  have the performance problems I had expected.

The tree representation uses gif-icons to provide the plus/minus and
Folder/Leaf graphics. I'd like to pack these graphics into the tag-library
so the user doesn't have to provide links to these icons inside the tag. At
the moment, the page looks like

<arp:tree xmlurl="aUrl" plusicon="/icons/plus.gif"
minusicon="/icons/minus.gif"
   foldericon="/icons/folder.gif" leaficon="/icons/leaf.gif"
   node="mynode" >
</arp:tree>

As you can imagine, that is quite error-prone. Sine the icons are always the
same, I'd prefer to have a representation like

<arp:tree xmlurl="aUrl" node="mynode">
</arp:tree>

and have the icons packed in the library.

Any idea how to realize that?

Armin


Re: Including Resources into a taglib

Posted by Eduardo Pelegri--Llopart <Ed...@eng.sun.com>.
It is not always the case that a general tag is better than a specific
tag.  Performance, for example, is one area.  Another is ease of
description/use.  BTW, it has been propsed to add a mechanism to
specialize a tag based on others.  So one could define the new "tree"
tag based on the xsl:transform tag.

But I like XSLT quite a bit.  Pardon my not knowning but, did we end up
adding the xsl transform tag into jakarta-taglibs?  I know that Mandar
had been working on it...

	- eduard/o

Michal Mosiewicz wrote:
> 
> Armin Pfarr wrote:
> > [...]
> > <arp:tree xmlurl="aUrl" plusicon="/icons/plus.gif"
> > minusicon="/icons/minus.gif"
> >    foldericon="/icons/folder.gif" leaficon="/icons/leaf.gif"
> >    node="mynode" >
> > </arp:tree>
> 
> Generally, what's the purpose of such a strongly specialised tag?
> 
> I've developed something like this for my purposes:
> 
> <xsl:transform source="sourceDoc">
>  stylesheet here
> </xsl:transform>
> 
> And that's serves a whole class of different transformations. Not just
> directory-like presentation, which is possible of course.
> 
> -- Mike

Re: Including Resources into a taglib

Posted by Michal Mosiewicz <mi...@interdata.com.pl>.
Armin Pfarr wrote:
> [...]
> <arp:tree xmlurl="aUrl" plusicon="/icons/plus.gif"
> minusicon="/icons/minus.gif"
>    foldericon="/icons/folder.gif" leaficon="/icons/leaf.gif"
>    node="mynode" >
> </arp:tree>

Generally, what's the purpose of such a strongly specialised tag?

I've developed something like this for my purposes:

<xsl:transform source="sourceDoc">
 stylesheet here
</xsl:transform>

And that's serves a whole class of different transformations. Not just
directory-like presentation, which is possible of course.

-- Mike