Re: error message when the link has & sign

"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,
Ӓ 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 UTC