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 Interesting Xtags Bug
Date Tue, 15 Mar 2005 11:30:18 GMT
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