Bug 21928

Summary: Extra space added in the return text of xtags
Product: Taglibs Reporter: Grant <grantchan>
Component: XTags TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED LATER    
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Grant 2003-07-28 10:25:06 UTC
test.jsp returns sth like: 
- select value, description from ConfinedProperty where propertyUin=501 order 
by value - description 
- select value, description from ConfinedProperty where propertyUin=502 order 
by value - description 
- select value, description from ConfinedProperty where propertyUin=503 order 
by value - description 

But I don't know why the problem occurs when the xtags parser reaches 506:
- select value, description from ConfinedProperty where propertyUin=516 order 
by value - descrip tion 

"descrip tion" instead of "description"

Why the xtags taglib returns the text with an extra space (of course I never 
want this!!!!) ??

*** test.jsp ******************************************************************
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<% request.setCharacterEncoding("UTF-8"); %>
<% response.setContentType("text/html; charset=UTF-8"); %>
<%@ page import="com.radicasys.rmc.lang.Constants, 
org.apache.struts.util.MessageResources, org.apache.struts.action.Action" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>
<%@ page import="java.util.*, com.radicasys.util.*, java.sql.Connection, 
com.radicasys.rmc.beans.ClientConnector" %>
<%@ page import="org.dom4j.Node" %>

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Hello RSS Demo</title>
<link rel="stylesheet" href="examples.css" type="text/css">
</head>

<body>

<h1>Hello RSS Demo</h1>

<ul>
<xtags:parse uri="/Customer.xml"/>
<xtags:forEach select="//queryTransformer">
  <li>
  <xtags:valueOf select="description"/>
  - 
  <xtags:valueOf select="query"/>
  - 
  <xtags:valueOf select="text"/>
  </li>
</xtags:forEach>
</ul>

</body>
</html>
*******************************************************************************



*** Customer.xml *************************************************************
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE blockStruct SYSTEM "rmc_custSegBlkStruct_1_0_0.dtd">

<blockStruct version="1.0.0">
  <!-- gender -->
  <queryTransformer qtnum="1">
    <query>select value, description from ConfinedProperty where 
propertyUin=501 order by value</query>
    <text>description</text>
    <value>value</value>
  </queryTransformer>

  <resultQueryTransformer rqtnum="1">
    <query procedure="" class="">select u.userUin from RPSUser as u, 
RPSUserProperty as p where u.userUin=p.userUin and p.propertyUin=501 and 
u.state=1 and p.value=?</query>
    <queryparam order="1" class="String" />
  </resultQueryTransformer>

<!-- p.propertyUin=501 until 516 -->
<!-- Apart from PropertyUin, all values remain the same, e.g.the node value 
of "text" and "value" remains as "desription" and "value" respectively -->

</blockStruct>
*******************************************************************************
Comment 1 David Valentine 2003-09-25 23:33:43 UTC
I have had this happen, in at least two cases. 
Seems to happen within a forEach block.

(I'll try to remember to work up a test case)

Comment 2 Henri Yandell 2009-11-29 19:47:32 UTC
Resolving. Taglib has been retired.