tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Trcko" <>
Subject taglibs and xsl problem
Date Fri, 09 May 2003 09:39:42 GMT

I have problem with xsl and taglibs-xtags.tld

This is my jsp file in which I connect to URL and then show styled data using xsl file.
My question is how to check that I can connect to this URL (real URL will not be localhost,
this is just sample) and if i can't, write a message (e.g. Could not connect to URL).

<%@ taglib uri="/WEB-INF/tlds/taglibs-xtags.tld" prefix="xsltlib" %>
<body bgcolor="white">
<font color="red">Info</font>
<xsltlib:style xml="http://localhost:8083/web/xml_sample.xml" xsl="/WEB-INF/templates/jsp/layouts/xsl_sample.xsl"/>

This is my xsl file, and my next question is how to test if "event" exists in xml file, because
otherwise I want to write a message (e.g. No data). I try code below, but
when there is no "event" in the XML file, message "No data" is not written.

<xsl:when test="event">
<xsl:for-each select="event">
<xsl:value-of select="@entry"/>
<xsl:value-of select="@message" disable-output-escaping="yes"/>
No data

This is my XML file with one event:

<?xml version="1.0" encoding="windows-1250" ?>
<info_xml lang="SLO">
<event id="32350" entry="08.05.2003 14:07" message="some text" />
when there are no events the XML looks like:

<?xml version="1.0" encoding="windows-1250" ?>
<info_xml lang="SLO">

Any ideas?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message