This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Passing custom tags to jsp via xsl
- From: Mike Brown <mike at chilled dot skew dot org>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 25 Apr 2002 10:13:34 -0600 (MDT)
- Subject: Re: [xsl] Passing custom tags to jsp via xsl
- Reply-to: xsl-list at lists dot mulberrytech dot com
Denis McCarthy wrote:
> <xsl:template match="columnValue">
> <td class="listCell">
> <ramtag:loc label="
> <xsl:value-of select="."/>
> >
> </td>
> </xsl:template>
> I would like the jsp to interpret the '<ramtag' tag, but I'm getting an xsl
> error when I try it like this.
XSLT does not deal in tags. Producing output is not a matter of serially
pasting together strings of text. Leave that for lower level markup languages
like PHP and CFML, which amount to little more than server-side includes. In
XSLT you deal with node trees that are implied by the markup. You produce a
new node tree and then let the XSLT processor serialize it with whatever
markup ('tags') is appropriate for the kind of output you want. Read a good
tutorial on XPath and XSLT (Michael Kay's XSLT book is the best) for a
thorough explanation.
In the mean time, this should work for you:
<td class="listCell">
<ramtag:loc label="{.}"/>
</td>
I assume you've declared a namespace for the 'ramtag' prefix
already. xmlns:ramtag="...something..."
- Mike
____________________________________________________________________________
mike j. brown | xml/xslt: http://skew.org/xml/
denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list