W3C home > Mailing lists > Public > www-svg@w3.org > July 2000

Re: error message when the link has & sign

From: Chris Lilley <chris@w3.org>
Date: Fri, 28 Jul 2000 17:55:24 +0200
Message-ID: <3981ACEC.916480EE@w3.org>
To: "Mai, Dung H" <Dung.Mai@PSS.Boeing.com>
CC: "'www-svg@w3.org'" <www-svg@w3.org>


"Mai, Dung H" wrote:
> 
> I wonder if some one can explain what could have been wrong if I included the & in the link

The ampersand character is used to start an entity reference. For example,
&#1234; or &someDefinedEntity;

>  such as
> <a xlink:href="http://bunker.ca.boeing.com/bpi/servlet/InfoManager?env=PPU_PD&requestBPROC&proc=DWH04">

Firstly there is no entity definition corresponding to the entity
&requestBPROC and secondly it is not correctly terminated with a semicolon,
so on meeting the second ampersant the XML parser detects that this is not
a well formed instance. All XML parsers will halt with an error.

Of course, you didn't mean to use an entity - you meant to include a
literal ampersand character in your URI. This can be done, because XML
predefined some commonly required entities including one for the ampersand
character:

&amp;

So, replace all the & in your URI with &amp; and the XML parser will be
happy, and when it is done parsing you will have & in the actual URL that
gets sent to the server, so your links will work.


Please note that including this link in an HTML page would also have caused
it to fail to validate. However, current HTML browsers attempt to "fix up"
invalid markup in assorted complex and undocumented ways, so you probably
would not have noticed this error before - 'many' browsers would handle
this in the way you probably meant. 

XML parsers have consistent parsing behavious and prompt reporting of
errors. This is a good thing.

--
Chris
Received on Friday, 28 July 2000 11:55:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 5 November 2012 23:52:47 GMT