W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2001

Handling Ampersands

From: Whitwell, Martyn <martyn.whitwell@ic.ac.uk>
Date: Wed, 20 Jun 2001 15:56:43 +0100
Message-ID: <B8E71A89E7E0D411B0E200A0C9D85B263480C9@icex6.cc.ic.ac.uk>
To: xmlschema-dev@w3.org
Dear all,

I'd like to define an element which will contain a URL to a resource

..
<xsd:element name="mylink" type="xsd:string" />
..

I have a problem regarding the URL - it contains ampersands (the "and"
symbol: &). e.g.:

<mylink>
	
http://www.streetmap.co.uk/streetmap.dll?grid2map?X=526500&Y=179400&arrow=Y
</mylink>

XML does not like these on their own, it prefers them escaped, i.e.

<mylink>
	
http://www.streetmap.co.uk/streetmap.dll?grid2map?X=526500&amp;Y=179400&amp;
arrow=Y
</mylink>

However, the escaped-ampersand version will not link to the website!

Is there anyway I can define the element's type so that it will allow
miscellaneous ampersands, or is it possible to un-escape the ampersand in a
stylesheet? (and if so, how?)

Thanks in advance for all your help.

Regards,

Martyn Whitwell.
Imperial College, London.
Received on Wednesday, 20 June 2001 10:56:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:21 GMT