Escape Characters Illegal XML characters have to be replaced by entity references.
If you place a character like "<" inside an XML element, it will generate an error because the parser interprets it as the start of a new element. You cannot write something like this:
<message>if salary < 1000 then</message>
To avoid this, you have to replace the "<" character with an entity reference, like this:
<message>if salary < 1000 then</message>
There are 5 predefined entity references in XML:
< < less than > > greater than & & ampersand ' ' apostrophe " " quotation mark
Entity references always start with the "&" character and end with the ";" character.
Note: Only the characters "<" and "&" are strictly illegal in XML. Apostrophes, quotation marks and greater than signs are legal, but it is a good habit to replace them.
From: Julie McCabe <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Subject: Re: encoding problems with XML
Date: Mon, 10 Nov 2003 13:55:32 +0000
MIME-Version: 1.0
Received: from mail.apache.org ([208.185.179.12]) by mc4-f13.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Mon, 10 Nov 2003 05:55:32 -0800
Received: (qmail 85441 invoked by uid 500); 10 Nov 2003 13:55:30 -0000
Received: (qmail 85428 invoked from network); 10 Nov 2003 13:55:29 -0000
Received: from unknown (HELO mailhub1.qub.ac.uk) (143.117.143.16) by daedalus.apache.org with SMTP; 10 Nov 2003 13:55:29 -0000
Received: from fujin.qub.ac.uk ([143.117.14.43])by mailhub1.qub.ac.uk with esmtp (Exim 4.20)id 1AJCVt-0005ab-Dufor [EMAIL PROTECTED]; Mon, 10 Nov 2003 13:55:29 +0000
Received: from [143.117.22.8] (helo=chicane.cs.qub.ac.uk)by fujin.qub.ac.uk with esmtp (Exim 3.35 #1)id 1AJCVt-0001yh-00for [EMAIL PROTECTED]; Mon, 10 Nov 2003 13:55:29 +0000
X-Message-Info: JGTYoYF78jEQ2fyJCYPUm8q/mv25sbwo
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Post: <mailto:[EMAIL PROTECTED]>
List-Id: "Tomcat Users List" <tomcat-user.jakarta.apache.org>
Delivered-To: mailing list [EMAIL PROTECTED]
Organization: BESC QUB
User-Agent: KMail/1.5
References: <[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
Message-Id: <[EMAIL PROTECTED]>
X-Spam-Score: -- (-2.5)
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 10 Nov 2003 13:55:33.0023 (UTC) FILETIME=[4F133AF0:01C3A792]
try &
On Monday 10 November 2003 14:50, Edson Alves Pereira wrote: > Hello folks, i�m trying to write some special characters in a XML > file, like: > <company> Doubs & Noble</company> > > But i don�t known the right encoding to [ & ] be validate properly, > any idea? > > Regards, > Edson
--
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Hot chart ringtones and polyphonics. Go to http://ninemsn.com.au/mobilemania/default.asp
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
