D
Digby
Hi,
I've found that the Jakarta RI for the JSTL XML taglib doesn't seem to
process xml docs with namespaces very well.
I have a simple snippet of jstl:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
<c:import var="feed" url="${src}"/> <%-- src cntains url below --%>
<xarse var="xml" xml="${feed}"/>
<td valign="top">
<x:forEach select="$xml//item" var="item">
<a href="<xut select="$item/link"/>" target="_blank"><xut
select="$item/title"/></a><br/>
<xut select="$item/description"/><br/>
</x:forEach>
and two xml sources - both rss news feeds, but one is RSS 0.91 and the other
1.0:
http://news.bbc.co.uk/rss/newsonline_uk_edition/uk/rss091.xml
http://theregister.co.uk/feeds/latest.rdf
The second one (RSS 1.0) contains references to namespaces, but the first
(0.91) doesn't, and the first is the one to be correctly displayed on the
screen.
I've tried doing similar things with other XML docs, but keep getting the
same problem - I can't parse xml with namespaces.
Am I missing something obvious? Or perhaps I've got an old version of the
taglib (I think I'm currently using 1.0, and going to try 1.1 when I get a
chance).
TIA
Digby
I've found that the Jakarta RI for the JSTL XML taglib doesn't seem to
process xml docs with namespaces very well.
I have a simple snippet of jstl:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
<c:import var="feed" url="${src}"/> <%-- src cntains url below --%>
<xarse var="xml" xml="${feed}"/>
<td valign="top">
<x:forEach select="$xml//item" var="item">
<a href="<xut select="$item/link"/>" target="_blank"><xut
select="$item/title"/></a><br/>
<xut select="$item/description"/><br/>
</x:forEach>
and two xml sources - both rss news feeds, but one is RSS 0.91 and the other
1.0:
http://news.bbc.co.uk/rss/newsonline_uk_edition/uk/rss091.xml
http://theregister.co.uk/feeds/latest.rdf
The second one (RSS 1.0) contains references to namespaces, but the first
(0.91) doesn't, and the first is the one to be correctly displayed on the
screen.
I've tried doing similar things with other XML docs, but keep getting the
same problem - I can't parse xml with namespaces.
Am I missing something obvious? Or perhaps I've got an old version of the
taglib (I think I'm currently using 1.0, and going to try 1.1 when I get a
chance).
TIA
Digby