<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>problem with XmlTextWriter.WriteValue(string)</title><link>https://www.infopathdev.com:443/forums/thread/30899.aspx</link><pubDate>Mon, 28 Jul 2008 06:04:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30899</guid><dc:creator>Sirshendu</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30899.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=30899</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;I am creating Infopath form instances programmatically from a published form template in sharepoint form library and populating some fields inside the form with data. The data will contain &lt;b&gt;white spaces&lt;/b&gt; and &lt;b&gt;special character&lt;/b&gt;. &lt;/span&gt;&lt;span style="FONT-SIZE:11pt;FONT-FAMILY:&amp;#39;Calibri&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;I have used the following link for reference: &lt;span style="COLOR:#0072bc;"&gt;&lt;a href="http://enterprise-solutions.swits.net/infopath2007/programmatically-create-infopath-form-console-app.htm"&gt;http://enterprise-solutions.swits.net/infopath2007/programmatically-create-infopath-form-console-app.htm&lt;/a&gt;&lt;/span&gt; &lt;/span&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri"&gt;&lt;font size="3"&gt;In XmlTextWriter.WriteValue() method, if I pass a string of length more than &lt;/font&gt;&lt;b&gt;&lt;span style="FONT-SIZE:18pt;"&gt;6&lt;/span&gt;&lt;/b&gt;&lt;font size="3"&gt;, then generated xml is giving error saying “&lt;b&gt;Character &amp;#39; &amp;#39;, hexadecimal value 0x0 is illegal in XML documents&lt;/b&gt;”.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;"&gt;&lt;font face="Calibri" size="3"&gt;If the value is limited to 6 character then its generating xml without any error, though its contain white spaces…&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Can anyone guide me to come out from this issue?&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thanx&lt;/p&gt;</description></item></channel></rss>