Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 83336 invoked from network); 21 Jan 2007 02:05:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jan 2007 02:05:59 -0000 Received: (qmail 68177 invoked by uid 500); 21 Jan 2007 02:05:51 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 68153 invoked by uid 500); 21 Jan 2007 02:05:51 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 68142 invoked by uid 99); 21 Jan 2007 02:05:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jan 2007 18:05:51 -0800 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=MAILTO_TO_SPAM_ADDR X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [216.252.111.92] (HELO web56413.mail.re3.yahoo.com) (216.252.111.92) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 20 Jan 2007 18:05:42 -0800 Received: (qmail 82547 invoked by uid 60001); 21 Jan 2007 02:05:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=Q3ZYs8AOw0FIg7EdFwWYEGWwT6gTgJLW7eQkuOxQ+z36V6olY0xDTsttUknb+ELcjEBz1UMwjbO/hyfEmwy12pvlwsLJ5HM/ZHnxFXHM/cgoDM82Fvo87AwAUJPcVVTLAqW4WJH66B5768ggD9JF5xfdrB/c8gUjqijT7cPuilM=; X-YMail-OSG: OAvSwiYVM1n7UbB5BW_crU1vpN0tQSRwqeRiq51iGCNomF.9vewKjoeonDwQloCYI.VfPbLmVIIyptD383DU9oKUR7mcCgvkmVaVpet8vi6KW9Ovwpu9Xub8cvJxbGDEXkIqs8yu9G_170bbdplrpTOJYLhlzj7iZLc- Received: from [68.196.152.202] by web56413.mail.re3.yahoo.com via HTTP; Sat, 20 Jan 2007 18:05:21 PST X-Mailer: YahooMailRC/368.3 YahooMailWebService/0.6.132.7 Date: Sat, 20 Jan 2007 18:05:21 -0800 (PST) From: Rashmi Rubdi Subject: Re: Change the encoding format of xml outpu To: Tomcat Users List MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <832659.59865.qm@web56413.mail.re3.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org >From what I've experience (don't know if I can retrace it), the BOM charact= ers were probably inserted before the XML prolog, when the XML file was ope= ned in Notepad and then =0Asaved, it is probably due to difference in the e= ncoding used between editors. =0A=0ASome literature on BOM:=0Ahttp://msdn.m= icrosoft.com/library/default.asp?url=3D/library/en-us/intl/unicode_42jv.asp= =0A=0Ahttp://www.stanford.edu/~laurik/fsmbook/errata/BOM.html=0A=0AWhen the= XML file was opened with Internet Explorer, it didn't complain and rendere= d the XML tree as usual. =0A=0AXalan was strict about anything before the X= ML prolog, even the invisible BOM. =0A=0AWith certain JSTL tags like , if the xml file sp= ecified in c:import could not be located, then also it throws a "Content No= t Allowed in Prolog" instead of a "File Not Found" error.=0A=0A-Rashmi=0A= =0A----- Original Message ----=0AFrom: JV =0ATo: Tomcat Us= ers List =0ASent: Saturday, January 20, 2007 4:45:= 19 PM=0ASubject: Re: Change the encoding format of xml outpu=0A=0A=0AOkay, = to be clear, what i do is the following:=0A=0A<%@ page contentType=3D"appli= cation/xml" %>=0A=0AThis is t= he first line in my JSP page that creates XML. It's the =0Afirst line, fir= st character, no spaces inbetween the two =0Adeclarations. This works for = me.=0A=0AUp til now I've created XML using JSTL, and then I had more proble= ms =0Awith characters like 0A and 09, which messed up the XML. This was = =0Aespecially the case with SQL Server. So I removed those characters =0Af= rom the resultstring. I haven't had a problem with BOM-characters =0A(didn= 't even know they existed)!=0A=0A=0A=0A=0A=0AJV=0A=0A=0AOp 20 jan 2007, om 22:18 hee= ft Martin Gainty het volgende geschreven:=0A=0A> agreeing with the previous= post..I get this same error when the XML =0A> has any whitespace characte= rs before =0A> Martin--=0A> --------------------------------------= -------------------------------- =0A> -----=0A> This e-mail message (includ= ing attachments, if any) is intended for =0A> the use of the individual or= entity to which it is addressed and =0A> may contain information that is = privileged, proprietary , =0A> confidential and exempt from disclosure. If= you are not the =0A> intended recipient, you are notified that any dissem= ination, =0A> distribution or copying of this communication is strictly pr= ohibited.=0A> -------------------------------------------------------------= --------- =0A> -----=0A> Le pr=E9sent message =E9lectronique (y compris les= pi=E8ces qui y sont =0A> annex=E9es, le cas =E9ch=E9ant) s'adresse au des= tinataire indiqu=E9 et peut =0A> contenir des renseignements de caract=E8r= e priv=E9 ou confidentiel. Si =0A> vous n'=EAtes pas le destinataire de ce= document, nous vous signalons =0A> qu'il est strictement interdit de le d= iffuser, de le distribuer ou =0A> de le reproduire.=0A> ----- Original Mes= sage -----=0A> From: "Rashmi Rubdi" =0A> To: "= Tomcat Users List" =0A> Sent: Saturday, January 20= , 2007 2:51 PM=0A> Subject: Re: Change the encoding format of xml outpu=0A>= =0A>=0A> Sarah,=0A>=0A> I'm just following up on what JV mentioned.=0A>=0A>= The "Content is not allowed in prolog" is caused when there is the =0A> B= OM - Byte Order Mark character before the prolog =0A> The BOM = characters are 3 hexadecimal characters EF BB BF, and are =0A> invisible i= n editors like Notepad, Eclipse etc.=0A>=0A> When you are debugging your XM= L file you will need a Hex editor to =0A> see if the 3 characters are sti= ll being generated.=0A>=0A> The "Content is not allowed in prolog" error al= so occurs if your =0A> code is unable to locate an XML or XSL file, either= because it is =0A> misspelled, or not present in the directory etc.=0A>= =0A> -Rashmi=0A>=0A> ----- Original Message ----=0A> From: JV =0A> To: Tomcat Users List =0A> Sent: Saturday= , January 20, 2007 2:39:03 PM=0A> Subject: Re: Change the encoding format o= f xml outpu=0A>=0A>=0A> Hi Sarah,=0A>=0A> Have you included this in the pag= e-code?=0A>=0A> <%@ page contentType=3D"application/xml" %>=0A>=0A> JV=0A>= =0A> Op 20 jan 2007, om 20:19 heeft Sarah Parrott het volgende geschreven:= =0A>=0A>> Hi,=0A>>=0A>> I'm using Tomcat 5.5 from within eclipse, and using= java code to=0A>> create and=0A>> save a new xml document on the server. T= he first line in the xml=0A>> doc is=0A>>=0A>> =0A>>=0A>> If I try and view this in eclipse, or parse it us= ing a sax parser,=0A>> I get the=0A>> error 'content not allowed in prolog'= . However, I can open it fine in=0A>> something like notepad, and if I chan= ge the encoding in the file to=0A>> UTF-8,=0A>> it opens fine in eclipse/SA= X with no other modifications to the=0A>> file. How=0A>> can I change it so= it is written with UTF-8 in the first place?=0A>> I've tried=0A>> looking = in the server properties but every reference to encoding I=0A>> can find=0A= >> is already set to UTF-8. Is there something I'm missing? Or am I=0A>> go= ing to=0A>> have to do an xslt transformation each time read the xml?=0A>>= =0A>> Thanks in advance,=0A>> Sarah=0A>=0A>=0A> ---------------------------= ------------------------------------------=0A> To start a new topic, e-mail= : users@tomcat.apache.org=0A> To unsubscribe, e-mail: users-unsubscribe@tom= cat.apache.org=0A> For additional commands, e-mail: users-help@tomcat.apach= e.org=0A>=0A>=0A>=0A> _____________________________________________________= _________________ =0A> ______________=0A> 8:00? 8:25? 8:40? Find a flick in= no time=0A> with the Yahoo! Search movie showtime shortcut.=0A> http://too= ls.search.yahoo.com/shortcuts/#news=0A>=0A> -------------------------------= --------------------------------------=0A> To start a new topic, e-mail: us= ers@tomcat.apache.org=0A> To unsubscribe, e-mail: users-unsubscribe@tomcat.= apache.org=0A> For additional commands, e-mail: users-help@tomcat.apache.or= g=0A>=0A=0A=0A-------------------------------------------------------------= --------=0ATo start a new topic, e-mail: users@tomcat.apache.org=0ATo unsub= scribe, e-mail: users-unsubscribe@tomcat.apache.org=0AFor additional comman= ds, e-mail: users-help@tomcat.apache.org=0A=0A=0A =0A______________________= ______________________________________________________________=0ACheap talk= ?=0ACheck out Yahoo! Messenger's low PC-to-Phone call rates.=0Ahttp://voice= .yahoo.com --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org