How to enter < char in my text

Ian Pellew

Usenet Archive
Joined
Feb 19, 2004
Messages
13
Reaction score
0
Hi All;

Whats the xml way to have text include html type tags in?

<Value>
My text that will include <mytag> kjkjhkjh </mytag>
</value>

I am after shielding my text from the xml interpriter.

Regards
Ian
 

Patrick TJ McPhee

Usenet Archive
Joined
Apr 2, 2000
Messages
269
Reaction score
0
% Whats the xml way to have text include html type tags in? % % <Value> % My text that will include <mytag> kjkjhkjh </mytag> % </value>

% I am after shielding my text from the xml interpriter.

If you have a lot of text, use a CDATA section

<Value>
<![CDATA[My text that will include <mytag> kjkjhkjh </mytag>]]> </value>

If you want to include ]]> in the text, you have to end the CDATA section first.

If you have just one or two <s, you can use &lt;. This is one of five pre-defined entities which you will read about in any basic introduction to XML.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top