JSTL XML Transform losing tags

From: Alasdair Dougall (adrdsjd_at_talk21.com)
Date: 03/31/04


Date: 31 Mar 2004 03:11:09 -0800

Hi,

My problem is to do with JSTL, transform tag and the resulting text
returned in an x:out call.

Missing are tags, like <meta keywords="recipes, recipe, australian....
which are present in the transformed document (see below.)
 
The JSP:

<%@ page contentType="text/html; charset=iso-8859-1" language="java"
errorPage="" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %>
<!-- Import the file. In the future, check the cache first. -->
<c:choose>
        <c:when test="${param.pageid} == ''">
                <jsp:forward page="/recipeindex.jsp" />
        </c:when>
        <c:otherwise>
                <c:import url="${param.pageid}" var="xml"/>
                <c:import url="/schema/recipe-jstl.xsl" var="xsl"/>
                <x:transform xml="${xml}" xslt="${xsl}" var="doc" />
        </c:otherwise>
</c:choose>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
        <x:out select="$doc/recipe/headcontent" escapeXml="false" />
</head>
<body>
        <h1><x:out select="$doc/recipe/recipetitle" escapeXml="false"/></h1>
        <x:out select="$doc/recipe/description" escapeXml="false"/>
</body>
</html>

The result of the transform is:

------------------------------------------------------------
<?xml version="1.0" encoding="ISO8859_1"?>
<recipe>
   <headcontent>
      <title>Kangaroo Surf and Turf Kebabs recipes australian</title>
      <meta keywords="recipes, recipe, australian, australia,
kangaroo, seafood, surf and turf, prawns, salad"/>
   </headcontent>
   <recipetitle>
      <h1>
         <span class="title">Kangaroo Surf and Turf Kebabs</span>
      </h1>
   </recipetitle>
...
</recipe>
------------------------------------------------------------

and the output of the jsp is

<!-- Import the file. In the future, check the cache first. -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
    Pear and Almond Tart Recipe Cake
  </head>
  <body>
        <h1>Pear and Almond Tart</h1>

  </body>
</html>



Relevant Pages

  • JSTL XML Transform losing tags
    ... My problem is to do with JSTL, transform tag and the resulting text ... Missing are tags, like <meta keywords="recipes, recipe, australian.... ...
    (comp.lang.java.programmer)
  • Re: itertools question
    ... They really should just add grouperto itertools rather than leaving ... it as a recipe. ...
    (comp.lang.python)
  • Grilled Salad with Lemon
    ... Grilled Salad with Lemon ... Recipe Brought to you by FoodFit ... head radicchio ... Gently wash the lettuce quarters. ...
    (rec.food.recipes)
  • Re: photo distorted??
    ... Fine in the head and generous in the rump - a sometime recipe for a ... shapely horse. ...
    (rec.equestrian)
  • Re: Apricot Jam recipe needed
    ... While I hate to give Bob a swelled head his Apricot and Pineapple Jam ... to dig up a recipe that I liked. ... most of my preserving efforts end up in Xmas baskets - I rarely eat ...
    (rec.food.preserving)