<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Alex Medina &#187; error</title>
	<atom:link href="http://www.alexmedina.net/blog/tag/error/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alexmedina.net/blog</link>
	<description>Porque todos los días se aprende algo nuevo...</description>
	<lastBuildDate>Thu, 22 Dec 2011 09:40:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Solución error método Load de XDocument: &#8216;.&#8217;, valor hexadecimal 0&#215;00, es un carácter no válido.</title>
		<link>http://www.alexmedina.net/blog/2011/06/14/solucion-error-metodo-load-de-xdocument-valor-hexadecimal-0x00-es-un-caracter-no-valido/</link>
		<comments>http://www.alexmedina.net/blog/2011/06/14/solucion-error-metodo-load-de-xdocument-valor-hexadecimal-0x00-es-un-caracter-no-valido/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 10:13:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[caracter no valido hexadecimal]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[Linq to XML]]></category>
		<category><![CDATA[Load]]></category>
		<category><![CDATA[Parse]]></category>
		<category><![CDATA[XDocument]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.alexmedina.net/blog/?p=272</guid>
		<description><![CDATA[Siempre cargaba los documentos XML del streamReader de esta forma: &#160; XDocument myXmlDocument = XDocument.Load(myReader, LoadOptions.None); Hasta que hace unos días me salía un error con un documento que decía: &#160; &#8216;.&#8217;, valor hexadecimal 0&#215;00, es un carácter no válido. Línea XXX, posición XX. (casualmente siempre me indicaba la última línea) &#160; Bueno&#8230; y como [...]]]></description>
			<content:encoded><![CDATA[<p>Siempre cargaba los documentos XML del streamReader de esta forma:</p>
<p>&nbsp;</p>
<pre><span style="color: #339966;">XDocument myXmlDocument = XDocument.Load(myReader, LoadOptions.None);</span></pre>
<pre><span style="color: #339966;">
</span></pre>
<p>Hasta que hace unos días me salía un error con un documento que decía:</p>
<p>&nbsp;</p>
<p><strong><em>&#8216;.&#8217;, valor hexadecimal 0&#215;00, es un carácter no válido. Línea XXX, posición XX.</em></strong> (casualmente siempre me indicaba la última línea)</p>
<p>&nbsp;</p>
<p>Bueno&#8230; y como podía ser esto posible&#8230; si yo veía el XML correcto, muy bien a ciencia cierta no lo se pero encontré una solución que al menos lo que hace es eliminar todos los caracteres hexadecimales de la cadena de carga de XML.</p>
<p>&nbsp;</p>
<p>Utilizando esta función en mi caso:</p>
<pre><span style="color: #339966;">public static string CleanInvalidXmlChars(string text)        {           </span>
<span style="color: #339966;">// From xml spec valid chars:             </span>
<span style="color: #339966;">// #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]                 </span>
<span style="color: #339966;">// any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.             </span></pre>
<pre><span style="color: #339966;">string re = @"[^\x09\x0A\x0D\x20-\xD7FF\xE000-\xFFFD\x10000-x10FFFF]";            </span>
<span style="color: #339966;">return Regex.Replace(text, re, "");        </span>
<span style="color: #339966;">}</span></pre>
<pre><span style="color: #339966;">
</span></pre>
<p>Y cambiando el Load por el Parse:</p>
<pre><span style="color: #339966;">XDocument myXmlDocument = XDocument.Parse( CleanInvalidXmlChars(myReader.ReadToEnd()), LoadOptions.None);</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.alexmedina.net/blog/2011/06/14/solucion-error-metodo-load-de-xdocument-valor-hexadecimal-0x00-es-un-caracter-no-valido/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error en el inicio de instalación VS2008</title>
		<link>http://www.alexmedina.net/blog/2010/05/06/error-en-el-inicio-de-instalacion-vs2008/</link>
		<comments>http://www.alexmedina.net/blog/2010/05/06/error-en-el-inicio-de-instalacion-vs2008/#comments</comments>
		<pubDate>Thu, 06 May 2010 16:15:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[instalación]]></category>
		<category><![CDATA[vs2008]]></category>

		<guid isPermaLink="false">http://alexmedina.net/blog/?p=108</guid>
		<description><![CDATA[Si al iniciar la instalación de Visual Studio 2008 te produce un error y tienes instalado Microsoft Office 2007&#8230; tienes la solución aqui¡¡ Se trata del Infopath que trae dicha versión, para desistalarlo solo tienes que ejecutar esto: msiexec /x {30120000-0044-0C0A-0000-0000000FF1CE}]]></description>
			<content:encoded><![CDATA[<p>Si al iniciar la instalación de Visual Studio 2008 te produce un error y tienes instalado Microsoft Office 2007&#8230;<br />
tienes la solución aqui¡¡ Se trata del <strong>Infopath </strong>que trae dicha versión, para desistalarlo solo tienes que ejecutar esto:</p>
<pre><strong><code>msiexec /x {30120000-0044-0C0A-0000-0000000FF1CE}</code></strong></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.alexmedina.net/blog/2010/05/06/error-en-el-inicio-de-instalacion-vs2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

