Home > Archive > MS SQL XML > July 2005 > Re: British pound sign (£) in xml causes error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: British pound sign (£) in xml causes error
McGeeky

2005-07-13, 3:23 am

This query shows the problem:

select
1 as tag,
null as parent,
'£' as 'Root!1!Pound',
'<' as 'Root!1!LessThan'
for
xml explicit

Results in the following which is invalid XML:

<Root Pound="£" LessThan="&lt;"/>

The less than gets converted correctly but the pound sign doesn't. It should
come out as this

<Root Pound="£" LessThan="&lt;"/>

--
McGeeky
http://mcgeeky.blogspot.com


"McGeeky" <anon@anon.com> wrote in message
news:%23MdxCE4hFHA.320@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> I am creating xml using for xml explicit. Some of the data contains the
> British pound sign £. When later processing the xml I get errors about an
> invalid character in the xml - its the pound sign. Why does for xml
> explicit not escape it like it has done with other illegal characters?
> What is the best way to deal with the pound signs?
>
> Thanks
>
> --
> McGeeky
> http://mcgeeky.blogspot.com
>
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com