XML cdata error

L

Larry

Hi guys,

I'm having trouble with the following code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE db
[
<!ELEMENT db (title)>
<!ELEMENT title (#PCDATA)>
]>

<db>
<title>"%%&&&hello!!!"</title>
</db>

It doesn't work at all...any suggests would be appreciateds, thanks
 
S

Soren Kuula

Larry said:
<db>
<title>"%%&&&hello!!!"</title>
</db>

It doesn't work at all...any suggests would be appreciateds, thanks

You must escape your ampersands, as they have a special meaning -- they
are used for -- escaping ! Use &amp; instead.

Soren
 
M

Martin Honnen

Larry wrote:

I'm having trouble with the following code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE db
[
<!ELEMENT db (title)>
<!ELEMENT title (#PCDATA)>
]>

<db>
<title>"%%&&&hello!!!"</title>
</db>

It doesn't work at all...any suggests would be appreciateds

Use what your subjects says, a CDATA section
<title><![CDATA["%%&&&hello!!!"]]></title>
Or escape every ampersand as &amp;.
 

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
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top