W3C home > Mailing lists > Public > www-validator@w3.org > June 2007

Re: Problems validating XML

From: olivier Thereaux <ot@w3.org>
Date: Tue, 19 Jun 2007 13:24:22 -0400
Message-Id: <5D1E8702-0F35-4EA4-AA04-468C74639A99@w3.org>
Cc: www-validator@w3.org
To: Martin Duerst <duerst@it.aoyama.ac.jp>

Hello Martin,

On May 30, 2007, at 05:22 , Martin Duerst wrote:
> I can definitely submit a patch that goes into XML mode if an
> XML declaration is present.

Are you (still) working on this? If not, I am thinking of going ahead  
with an implementation based on the following regexp, using a test  
for it in the first line of the content:

/^<\?xml[\x20|\x9|\xD|\xA]+(version=("1.0"|"1.1"|'1.0'|'1.1')[\x20| 
\x9|\xD|\xA]+)?(encoding=("[A-Za-z][a-zA-Z0-9-_]+"|'[A-Za-z][a-zA- 
Z0-9-_]+')\x20|\x9|\xD|\xA]+)?(standalone=("yes"|"no"|'yes'|'no') 
[\x20|\x9|\xD|\xA]+)?[\x20|\x9|\xD|\xA]*\?>[\x20|\x9|\xD|\xA]*$/

It should match XML declarations as defined by XML 1.0 and 1.1 specs,  
and not be too greedy.

-- 
olivier
Received on Tuesday, 19 June 2007 17:24:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:24 GMT