How to show literal angle bracket in description?

107 views
Skip to first unread message

bryce

unread,
Nov 9, 2007, 10:53:09 AM11/9/07
to KML Developer Support - Getting Started with KML
Hello all,

It seems a simple question and I expected I could find an answer
easily here but couldn't.

I want to write the angle bracket '<' inside description tags like "<
25" (less than 25) and not as html tags.
I tried both with and without CDATA but failed.

<description>&lt; 25 (less than 25)</description>
<description><![CDATA[
<table><tr><td>&lt; 25 (less than 25)</td></tr></table>
]]></description>


The only way I found to show < is to use CDATA without any html tags.

<description><![CDATA[&lt; 25 (less than 25)]]></description>

But this is not my solution because I need to include a lot of HTML
contents (e.g. table).

Any solutions?

Here is the sample KML for your reference.
http://seamap.env.duke.edu/tools/test.kml

Thanks,

barryhunter [KML Guru]

unread,
Nov 9, 2007, 11:42:48 AM11/9/07
to KML Developer Support - Getting Started with KML
A stab in the dark (dont have GE available to test)

<description><![CDATA[
<table><tr><td>&amp;lt; 25 (less than 25)</td></tr></table>
]]></description>

bryce

unread,
Nov 9, 2007, 3:35:30 PM11/9/07
to KML Developer Support - Getting Started with KML
Thanks, Barry.

I thought it would make sense. In fact, it doesn't work as expected.

Without CDATA, &amp;lt; shows "< 25". That's good.
<description>&amp;lt; 25 (less than 25)</description>

But, with CDATA as you suggested, it doesn't become "< 25".

Is this a bug?
By the way, &gt; turns to ">" properly within CDATA.

barryhunter [KML Guru]

unread,
Nov 9, 2007, 5:19:18 PM11/9/07
to KML Developer Support - Getting Started with KML
Ah, have GE to try it with now, and this works :)

<description><![CDATA[<table><tr><td>&gt; - &#60;</td></tr></
table>]]></description>

not sure why the &lt; doesn't work, but the numeric version does, but
it a least it works.

Jonathan van Tuijl

unread,
Nov 10, 2007, 1:08:04 AM11/10/07
to KML Developer Support - Getting Started with KML
barryhunter [KML Guru] wrote:
> not sure why the &lt; doesn't work, but the numeric version does, but
> it a least it works.

Because GE is bug-ridden...

Jonathan

bryce

unread,
Nov 15, 2007, 9:58:32 AM11/15/07
to KML Developer Support - Getting Started with KML
Thanks, Barry and sorry for the late response. I was traveling.

The &#60; works. GE should fix this problem but I'm glad to find a
workaround. Thanks.
Reply all
Reply to author
Forward
0 new messages