Re: invalid xml chars returned in select .. for xml auto

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Michael Rys [MSFT] (mrys_at_online.microsoft.com)
Date: 01/26/05


Date: Wed, 26 Jan 2005 15:00:15 -0800

Andrew is correct. Assuming that you may have an XML 1.1 parser, FOR XML in
SQL Server 2005 will entitize such invalid characters (note: Neither MSXML
nor System.XML provide an XML 1.1 parser), but an XML 1.0 parser will still
fail. You could also just avoid outputting such characters.

Best regards
Michael

""Andrew Conrad"" <aconrad@microsoft.com> wrote in message
news:Vf$LwawAFHA.768@cpmsftngxa10.phx.gbl...
> This will not work because entities are only allowed for legal characters.
>
> You will either need to base64 or hex encode the field. This can be done
> by casting the field as binary in the For Xml statement.
>
> Andrew Conrad
> Microsoft Corp
> http://blogs.msdn.com/aconrad
>



Relevant Pages

  • Re: non SGML character escape
    ... data and create xml file. ... to escape these characters. ... Even though XML Validator fails can XSLT validation by pass these ... (a standards-compliant parser will), and since parsing is a prerequisite ...
    (comp.lang.java.programmer)
  • Re: Special Characters not resolving
    ... starting data at the origin in an ORacle database is 2000 characters. ... When the XML isdelivered to me on disk and I load an ... Obviously I need to find either a way to have the XML file provider strip ...
    (microsoft.public.dotnet.xml)
  • Re: XML SAX parser bug?
    ... > I think I ran into a bug in the XML SAX parser. ... the SAX parser misreads the line. ... > I put a 'print characters' line in the 'characters' method of the ...
    (comp.lang.python)
  • Re: Special Characters not resolving
    ... various characters are resolved. ... Here is an example cut from 2 .XML files. ... write to disk to resolve the characters then load again. ... I have an XML file that is generated by Oracle. ...
    (microsoft.public.dotnet.xml)
  • Re: Serving RSS feeds
    ... so you need to handle some non-ASCII characters. ... You can't do this with the XML prolog, because the web server HTTP ... addtype application/rss+xml rss ...
    (uk.net.web.authoring)