<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Whitespace is not allowed at this location: IP 2003</title><link>https://www.infopathdev.com:443/forums/thread/38504.aspx</link><pubDate>Tue, 17 Feb 2009 15:12:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38504</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38504.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=38504</wfw:commentRss><description>&lt;p&gt;Thank you for the very kind words.&amp;nbsp; I&amp;#39;m glad I was able to help you on your way and I&amp;#39;ll be happy to help you again in the future.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Jimmy&lt;/p&gt;</description></item><item><title>Re: Whitespace is not allowed at this location: IP 2003</title><link>https://www.infopathdev.com:443/forums/thread/38499.aspx</link><pubDate>Tue, 17 Feb 2009 14:20:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38499</guid><dc:creator>ZaiZai</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38499.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=38499</wfw:commentRss><description>&lt;p&gt;Jimmy,&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t thank you enough for working with me on this.&amp;nbsp; It works nicely.&amp;nbsp; I think it you were closer, I would stop by and shake your hand.&amp;nbsp; Anyway, I have a lot of respect for you and everyone else in this forum that take the time to help users like myself while learning this product.&amp;nbsp; Thank you Jimmy.&lt;/p&gt;</description></item><item><title>Re: Whitespace is not allowed at this location: IP 2003</title><link>https://www.infopathdev.com:443/forums/thread/38451.aspx</link><pubDate>Mon, 16 Feb 2009 15:09:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38451</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38451.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=38451</wfw:commentRss><description>&lt;p&gt;As the comments directly above it suggest, the &amp;quot;ResultRow_19&amp;quot; part of this line will be different in every form.&amp;nbsp; Please look at the properties of the repeating table to which you are copying the data and find the appropriate value for your form:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;XDocument.View.ExecuteAction(&amp;quot;xCollection::insert&amp;quot;, &amp;quot;&lt;strong&gt;&lt;em&gt;ResultRow_19&lt;/em&gt;&lt;/strong&gt;&amp;quot;); &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;</description></item><item><title>Re: Whitespace is not allowed at this location: IP 2003</title><link>https://www.infopathdev.com:443/forums/thread/38448.aspx</link><pubDate>Mon, 16 Feb 2009 14:13:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38448</guid><dc:creator>ZaiZai</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38448.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=38448</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Jimmy,&lt;/p&gt;
&lt;p&gt;First thanks for taking the time on this.&amp;nbsp; I used the new code after I made my changes, but now some errors come up.&amp;nbsp; The first one is on line 43. &lt;/p&gt;
&lt;p&gt;The query cannot be run for the following DataObject: x&lt;br /&gt;InfoPath cannot run the specified query.&lt;br /&gt;[0x80040E14][Microsoft OLE DB Provider for SQL Server] Invalid column name &amp;#39;ID&amp;#39;.&lt;br /&gt;File:script.js&lt;br /&gt;Line:43&lt;/p&gt;
&lt;p&gt;Line: dc.Command = &amp;quot;SELECT * FROM [x] WHERE [x] = &amp;#39;&amp;quot; + field1.text + &amp;quot;&amp;#39; OR [ID] = &amp;#39;&amp;quot; + field1.text + &amp;quot;&amp;#39;&amp;quot;;&lt;/p&gt;
&lt;p&gt;I took a shot and used the old line from the first code you provided which is pretty much the same but without the last two parts&lt;/p&gt;
&lt;p&gt;dc.Command = &amp;quot;SELECT * FROM [x] WHERE [x] = &amp;#39;&amp;quot; + field1.text + &amp;quot;&amp;#39;&amp;quot;;&lt;/p&gt;
&lt;p&gt;I&amp;nbsp; then was getting the below error after I used the line above in the code.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;The specified varXmlToEdit value for the View.ExecuteAction call is not valid.&lt;br /&gt;File:script.js&lt;br /&gt;Line:81&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t been able to get past this error.&amp;nbsp; &lt;/p&gt;</description></item><item><title>Re: Whitespace is not allowed at this location: IP 2003</title><link>https://www.infopathdev.com:443/forums/thread/38445.aspx</link><pubDate>Mon, 16 Feb 2009 07:07:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38445</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38445.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=38445</wfw:commentRss><description>&lt;p&gt;Googling on the &amp;quot;Whitespace is not allowed at this location&amp;quot; error showed that it was occurring when people had an ampersand by itself in XML.&amp;nbsp; I imagine an unpleasant error also would have happened if any of your DB fields had contained left angle brackets &lt;strong&gt;&amp;lt;&lt;/strong&gt;.&amp;nbsp; In general it is not a good idea to create XML using string concatenation like I was doing, but as I don&amp;#39;t do much InfoPath programming in JScript, I had been unable to think of a better method at the time.&lt;/p&gt;
&lt;p&gt;I have updated the code in my original post:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infopathdev.com/forums/p/9471/36486.aspx#36486"&gt;http://www.infopathdev.com/forums/p/9471/36486.aspx#36486&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and it should not suffer from either of those limitations.&amp;nbsp; The main differences between the new code and what you have now are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;the &lt;em&gt;columnNames&lt;/em&gt; array is no longer needed and has been removed.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;The contents of the for-loop have changed entirely except for the first line.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;The CreateNode() function is no longer needed and has been removed.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;</description></item><item><title>Re: Whitespace is not allowed at this location: IP 2003</title><link>https://www.infopathdev.com:443/forums/thread/38432.aspx</link><pubDate>Sat, 14 Feb 2009 05:24:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38432</guid><dc:creator>ZaiZai</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38432.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=38432</wfw:commentRss><description>&lt;p&gt;Wow, you are right on the &amp;quot;&amp;amp;&amp;quot;. All the ones that I just tested have &amp;quot;&amp;amp;&amp;quot; in the fields.&amp;nbsp; How did you know by looking at the code that it was this character that was the issue?&amp;nbsp; Also, are there any other characters that u know might cause this type of an error?&amp;nbsp; &lt;/p&gt;</description></item><item><title>Re: Whitespace is not allowed at this location: IP 2003</title><link>https://www.infopathdev.com:443/forums/thread/38431.aspx</link><pubDate>Sat, 14 Feb 2009 05:15:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38431</guid><dc:creator>ZaiZai</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38431.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=38431</wfw:commentRss><description>&lt;p&gt;I appreciate it Jimmy.&amp;nbsp; I assume that when you say &amp;quot;It looks like this is happening when you have a DB field with an ampersand in it.&amp;quot;, sometimes the values in one of the fields that I am pulling from SQL have &amp;quot;&amp;amp;&amp;quot; in it.&amp;nbsp; If this is the case, then yes, it would not surprise me that some of the fields values in the SQL table use the &amp;quot;&amp;amp;&amp;quot;.&amp;nbsp; I will research again knowing what u think might be the issue.&amp;nbsp;I appreciate it Jimmy. &lt;/p&gt;
&lt;p&gt;Will you be modify line 87 or another line?&lt;/p&gt;</description></item><item><title>Re: Whitespace is not allowed at this location: IP 2003</title><link>https://www.infopathdev.com:443/forums/thread/38429.aspx</link><pubDate>Sat, 14 Feb 2009 03:14:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38429</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38429.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=38429</wfw:commentRss><description>&lt;p&gt;I see.&amp;nbsp; It looks like this is happening when you have a DB field with an ampersand in it.&amp;nbsp; I&amp;#39;m working on an improved version of this code that won&amp;#39;t have that problem and will put it up here in a day or so.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Jimmy&lt;/p&gt;</description></item><item><title>Re: Whitespace is not allowed at this location: IP 2003</title><link>https://www.infopathdev.com:443/forums/thread/38399.aspx</link><pubDate>Fri, 13 Feb 2009 10:47:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38399</guid><dc:creator>ZaiZai</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38399.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=38399</wfw:commentRss><description>&lt;p&gt;Jimmy,&lt;/p&gt;
&lt;p&gt;It works most of the time like I said.&amp;nbsp; It is very helpful. Here is the code as it stands now.&amp;nbsp; I was trying to remove anything that I thought might be the cause so there are less blank lines in the code. With that said, the error line is at LINE: 87 and not 99 which was the line I had said in the orginial post.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here is LINE: 87&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataFields.appendChild(CreateNode(nodeString));&lt;/p&gt;</description></item><item><title>Re: Whitespace is not allowed at this location: IP 2003</title><link>https://www.infopathdev.com:443/forums/thread/38392.aspx</link><pubDate>Fri, 13 Feb 2009 03:50:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38392</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38392.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=38392</wfw:commentRss><description>&lt;p&gt;Hello again.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Sorry the code isn&amp;#39;t working so well for you.&amp;nbsp; Could you paste here some of&amp;nbsp;the code before and after line 99 and specifically indicate which line is 99?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks.&lt;/p&gt;</description></item><item><title>Whitespace is not allowed at this location: IP 2003</title><link>https://www.infopathdev.com:443/forums/thread/38388.aspx</link><pubDate>Fri, 13 Feb 2009 02:49:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38388</guid><dc:creator>ZaiZai</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38388.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=38388</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Can someone direct me in a fix for this?&amp;nbsp; I am getting this error when I click a button with code.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The error:&lt;/p&gt;
&lt;p&gt;&amp;quot;The following error occurred: &lt;/p&gt;
&lt;p&gt;Whitespace is not allowed at this location.&lt;/p&gt;
&lt;p&gt;File:script.js&lt;/p&gt;
&lt;p&gt;Line:99&amp;quot;&lt;/p&gt;
&lt;p&gt;The jscript code behind the button works most of the time, but the above error also occurs sometimes for certain records that the button is supposed to retrieve data for from a secondary data source.&amp;nbsp; I have done some testing and research on this and haven&amp;#39;t had much luck.&amp;nbsp; Any ideas on how to identify where these whitespaces are coming from and how I can use perhaps the normalize-space function? Is this even a problem I can fix in IP or am I going to have to resolve it from within SQL server?&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Basically, how would I go about trimming text to make sure that whitespaces are removed either in my current jscript code setup or by using the normalize-space function via rules. &lt;/p&gt;
&lt;p&gt;JIMMY, if are reading this, this is the jscript code you were helping with a little while ago.&amp;nbsp; It works most of the times, but I need to be able to have it work all the time.&amp;nbsp; What are your thoughts on these whitespaces?&lt;/p&gt;
&lt;p&gt;Thanks to anyone who can help on this matter.&lt;/p&gt;
&lt;p&gt;IP 2003&lt;/p&gt;</description></item></channel></rss>