tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Malcolm Cowe <Malcolm.C...@Sun.COM>
Subject Re: Interesting Xtags Bug
Date Wed, 16 Mar 2005 08:13:56 GMT
That's what I want, but it's not what I'm getting! A cut and paste
of your code fragment produces this result:

<job>

<var name="url"><![CDATA[http://localhost:8084/checklist]]><![CDATA[/update.jsp]]></var>
</job>

My platform is:

Solaris 9 update 3 on Sparc
Tomcat 5.0.28
Sun java j2sdk1.4.2_04
dom4j 1.3
XTags 20040615

I'll try updating my dom4j version to see if that helps. As
far as I know, XTags itself hasn't been updated recently, but
I'll grab a fresh nightly of that just in case.

Regards,

Malcolm.


Kris Schneider wrote:
> Here's what I used to recreate this:
> 
> JDK 1.4.2
> WinXP Pro
> 
> Tomcat 5.0.28
> Xerces 2.6.2 & Xalan 2.6.0 installed in $CATALINA_HOME/common/endorsed
> 
> WEB-INF/lib
> XTags nightly (20050315)
> dom4j 1.5.2
> 
> xtags.jsp:
> ----------
> <%@ page contentType="text/xml" %>
> 
> <%@ taglib prefix="xtags" uri="http://jakarta.apache.org/taglibs/xtags-1.0" %>
> 
> <xtags:parse id="lxml">
> <my>
> <loc url="http://localhost:8084/checklist/update.jsp">My location</loc>
> </my>
> </xtags:parse>
> 
> <xtags:parse id="streamxml">
> <job>
> </job>
> </xtags:parse>
> 
> <xtags:context select="$streamxml/job">
> <xtags:add>
> <var name="url"><![CDATA[<xtags:valueOf select="$lxml/my/loc/@url"/>]]></var>
> </xtags:add>
> </xtags:context>
> 
> <xtags:copyOf select="$streamxml"/>
> 
> Which produced:
> 
> <job>
> <var name="url"><![CDATA[http://localhost:8084/checklist/update.jsp]]></var>
> </job>
> 
> Is that what you wanted?
> 
> Quoting Malcolm Cowe <Malcolm.Cowe@Sun.COM>:
> 
> 
>>Hi,
>>
>>I'm trying to assemble an XML document that contains a URL as CDATA in
>>one of the tags. I'm using xtags:add to insert elements into an existing
>>XML structure, and I'm getting the following output:
>>
>><job>
>>  <var
>>
> 
> name="url"><![CDATA[http://localhost:8084/checkl]]><![CDATA[ist/update.jsp]]></var>
> 
>></job>
>>
>>As you can see, the URL is cut in two, making 2 CDATA segments, which is
>>not what I expected. This is based on the following code fragment:
>>
>><xtags:context select="$streamxml/job">
>><xtags:add>  <var name="url"><![CDATA[<xtags:valueOf
>>select="$lxml/my/loc/@url"/>]]></var>
>></xtags:add>
>></xtags:context>
>>
>>The "<xtags:valueOf select="$lxml/my/loc/@url"/>" statement yields
>>this when called elsewhere in the code (as expected):
>>
>>http://localhost:8084/checklist/update.jsp
>>
>>Furthermore, if I add a second var element with exactly the same
>>content, the second element is rendered correctly:
>>
>><job>
>>  <var
>>
> 
> name="url"><![CDATA[http://localhost:8084/checkl]]><![CDATA[ist/update.jsp]]></var>
> 
>>  <var
>>name="url"><![CDATA[http://localhost:8084/checklist/update.jsp]]></var>
>></job>
>>
>><xtags:context select="$streamxml/job">
>><xtags:add>  <var name="url"><![CDATA[<xtags:valueOf
>>select="$lxml/my/loc/@url"/>]]></var>
>>   <var name="url"><![CDATA[<xtags:valueOf
>>select="$lxml/my/loc/@url"/>]]></var>
>></xtags:add>
>></xtags:context>
>>
>>
>>Bizarre. This is quite frustrating, but I have started to remove these
>>CDATA wrappers in order to work around the problem. The reason for
>>their inclusion in the first place to to be in 100% compliance with
>>an external interface specification, but the interface works without
>>the CDATA wrapper, so I'm in the clear for now.
>>
>>Is this a real bug, or have I missed something obvious?
>>
>>Regards,
>>
>>
>>Malcolm.
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message