<?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>Re: RTF data in secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/14481.aspx</link><pubDate>Mon, 25 Sep 2006 17:39:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14481</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14481.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14481</wfw:commentRss><description>Hi Karsten,&lt;br /&gt;Thanks. Let us know if you have any problems using the code or if you are going to take a different approach. We have actually used this code in projects so it has been tested, etc. Good luck!</description></item><item><title>Re: RTF data in secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/14480.aspx</link><pubDate>Mon, 25 Sep 2006 10:51:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14480</guid><dc:creator>Karsten Brocksieper</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14480.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14480</wfw:commentRss><description>Hi Jim and Patrick,&lt;br /&gt;&lt;br /&gt;thank you very much for your efforts to help us.&lt;br /&gt;&lt;br /&gt;I hope that this code will help not only myself but many others cause I know that this is a popular problem in many infopath forums.&lt;br /&gt;</description></item><item><title>Re: RTF data in secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/14479.aspx</link><pubDate>Fri, 22 Sep 2006 23:41:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14479</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14479.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14479</wfw:commentRss><description>Thanks Jim!!!</description></item><item><title>Re: RTF data in secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/14478.aspx</link><pubDate>Fri, 22 Sep 2006 06:13:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14478</guid><dc:creator>Jim Cantwell</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14478.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14478</wfw:commentRss><description>Below is a template to convert richtext that has been encoded and stored in a database to XHTML.  This has been extracted from a larger transform used on a project which passed richtext fields as strings within an element.  The xslt then transformed those nodes into XHTML.&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:stylesheet version="1.0"&lt;br /&gt;    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;xsl:output method="xml" indent="no" encoding="utf-8" /&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;xsl:template match="RichTextNode"&amp;gt;&lt;br /&gt;    &amp;lt;!-- store in tmp variable and emit below with escaping disabled --&amp;gt;&lt;br /&gt;    &amp;lt;xsl:variable name="tmp"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:call-template name="xhtml-decode"&amp;gt;&lt;br /&gt;        &amp;lt;xsl:with-param name="text" select="." /&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:variable&amp;gt;&lt;br /&gt;    &amp;lt;xsl:value-of disable-output-escaping="yes" select="$tmp" /&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &lt;br /&gt;  &amp;lt;!-- Replace encoded &amp;lt; &amp;gt; &amp;amp; &amp;quot; &amp;apos; with unencoded versions for output --&amp;gt;&lt;br /&gt;  &amp;lt;!-- Note: replacement is order dependent --&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template name="xhtml-decode"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:param name="text" /&amp;gt;&lt;br /&gt;    &amp;lt;xsl:variable name="tmp"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:call-template name="replace-substring"&amp;gt;&lt;br /&gt;        &amp;lt;xsl:with-param name="to" select="'&amp;amp;'" /&amp;gt;&lt;br /&gt;        &amp;lt;xsl:with-param name="from" select="'&amp;amp;amp;'" /&amp;gt;&lt;br /&gt;        &amp;lt;xsl:with-param name="value"&amp;gt;&lt;br /&gt;          &amp;lt;xsl:call-template name="replace-substring"&amp;gt;&lt;br /&gt;            &amp;lt;xsl:with-param name="to" select="concat('&amp;amp;','apos;')" /&amp;gt;&lt;br /&gt;            &amp;lt;xsl:with-param name="from" select="'&amp;amp;apos;'" /&amp;gt;&lt;br /&gt;            &amp;lt;xsl:with-param name="value"&amp;gt;&lt;br /&gt;              &amp;lt;xsl:call-template name="replace-substring"&amp;gt;&lt;br /&gt;                &amp;lt;xsl:with-param name="to" select="'&amp;quot;'" /&amp;gt;&lt;br /&gt;                &amp;lt;xsl:with-param name="from" select="'&amp;amp;quot;'" /&amp;gt;&lt;br /&gt;                &amp;lt;xsl:with-param name="value"&amp;gt;&lt;br /&gt;                  &amp;lt;xsl:call-template name="replace-substring"&amp;gt;&lt;br /&gt;                    &amp;lt;xsl:with-param name="to" select="'&amp;lt;'" /&amp;gt;&lt;br /&gt;                    &amp;lt;xsl:with-param name="from" select="'&amp;amp;lt;'" /&amp;gt;&lt;br /&gt;                    &amp;lt;xsl:with-param name="value"&amp;gt;&lt;br /&gt;                      &amp;lt;xsl:call-template name="replace-substring"&amp;gt;&lt;br /&gt;                        &amp;lt;xsl:with-param name="to" select="'&amp;gt;'" /&amp;gt;&lt;br /&gt;                        &amp;lt;xsl:with-param name="from" select="'&amp;amp;gt;'" /&amp;gt;&lt;br /&gt;                        &amp;lt;xsl:with-param name="value" select="$text" /&amp;gt;&lt;br /&gt;                      &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;                    &amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;                  &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;                &amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;              &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;            &amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;          &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;        &amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:variable&amp;gt;&lt;br /&gt;    &amp;lt;xsl:value-of select="$tmp" /&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template name="replace-substring"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:param name="value" /&amp;gt;&lt;br /&gt;    &amp;lt;xsl:param name="from" /&amp;gt;&lt;br /&gt;    &amp;lt;xsl:param name="to" /&amp;gt;&lt;br /&gt;    &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;      &amp;lt;xsl:when test="contains($value,$from)"&amp;gt;&lt;br /&gt;        &amp;lt;xsl:value-of select="substring-before($value,$from)" /&amp;gt;&lt;br /&gt;        &amp;lt;xsl:value-of select="$to" /&amp;gt;&lt;br /&gt;        &amp;lt;xsl:call-template name="replace-substring"&amp;gt;&lt;br /&gt;          &amp;lt;xsl:with-param name="value" select="substring-after($value,$from)" /&amp;gt;&lt;br /&gt;          &amp;lt;xsl:with-param name="from" select="$from" /&amp;gt;&lt;br /&gt;          &amp;lt;xsl:with-param name="to" select="$to" /&amp;gt;&lt;br /&gt;        &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:when&amp;gt;&lt;br /&gt;      &amp;lt;xsl:otherwise&amp;gt;&lt;br /&gt;        &amp;lt;xsl:value-of select="$value" /&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:otherwise&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;</description></item><item><title>Re: RTF data in secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/14477.aspx</link><pubDate>Thu, 21 Sep 2006 07:25:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14477</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14477.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14477</wfw:commentRss><description>I can't believe it has been since April. Yikes. OK, I'll ask someone to reply with the code tonight. Sorry for the delay.</description></item><item><title>Re: RTF data in secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/14476.aspx</link><pubDate>Wed, 20 Sep 2006 08:20:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14476</guid><dc:creator>Karsten Brocksieper</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14476.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14476</wfw:commentRss><description>Hi gianca,&lt;br /&gt;&lt;br /&gt;I´m sorry to say but the problem is still not resolved by me and my colleagues. In the meantime I have contacted Tim Pash (Infopath MVP)from Microsoft and he was very anxious to help us but the only way that he could suggested by now is -in my opinion- really complicated.&lt;br /&gt;He has sent me a link where at the bottom of this article is a sample which describe the way to use a webservice to fill the "Rich text control" --- but please have a look for yourself.&lt;br /&gt;&lt;br /&gt;&lt;a href='http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/office_infopath_using_datasets.asp' target='_blank' title='http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/office_infopath_using_datasets.asp'&lt;a target="_blank" href=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/office_infopath_using_datasets.asp&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/office_infopath_using_datasets.asp&lt;/a&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Please, share your experience with this... I´m very interested&lt;br /&gt;&lt;br /&gt;Regards,</description></item><item><title>Re: RTF data in secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/14475.aspx</link><pubDate>Wed, 20 Sep 2006 07:41:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14475</guid><dc:creator>gianca</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14475.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14475</wfw:commentRss><description>Hi, I have the same problem as yours. Did you risolve the problem?????&lt;br /&gt;Thanks&lt;br /&gt;Gianca</description></item><item><title>Re: RTF data in secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/14474.aspx</link><pubDate>Thu, 20 Apr 2006 23:02:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14474</guid><dc:creator>Karsten Brocksieper</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14474.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14474</wfw:commentRss><description>Hi Shyam,&lt;br /&gt;&lt;br /&gt;thank you for your efforts to help me.&lt;br /&gt;&lt;br /&gt;I truly have to say that I don´t know if the 'ntext' field is coming as an attribut or element. How can I identify if the data field is an attribute or an element?&lt;br /&gt;&lt;br /&gt;I have defined the secondary data connection in the same way like any other secondary data connection. I have used the wizard in the menu 'Tools, Data connection' and choose SQL server and my appropriate view.&lt;br /&gt;&lt;br /&gt;Is there a way that I can force the 'ntext' field coming as an element so that we can change the schema for that column. But even in this case I would appreciate your help cause I don´t know how to change the schema for that column.&lt;br /&gt;&lt;br /&gt;Hopefully looking forward... ;-))&lt;br /&gt;&lt;br /&gt;BTW: 'Good Night' as it´s late in the night in germany now and I would like to dream about elements and attributes now... ;-))</description></item><item><title>Re: RTF data in secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/14473.aspx</link><pubDate>Thu, 20 Apr 2006 22:26:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14473</guid><dc:creator>Shyam</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14473.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14473</wfw:commentRss><description>Is the 'ntext' field coming as an attribute or element. I think when we do secondary data connection to DB we will get the columns as attributes, if that is so then you will not be able to convert it to rich text field. If it is coming as element then you can change the schema for that column to accomodate XHTML.</description></item><item><title>Re: RTF data in secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/14472.aspx</link><pubDate>Thu, 20 Apr 2006 06:12:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14472</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14472.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14472</wfw:commentRss><description>Hi Karsten,&lt;br /&gt;Thanks for the great idea on a HowTo topic. We have code that does this. Send me e-mail and we'll mail it to you or wait a week and we'll add a HowTo on how to do this.</description></item><item><title>RTF data in secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/12841.aspx</link><pubDate>Tue, 11 Apr 2006 21:25:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12841</guid><dc:creator>Karsten Brocksieper</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12841.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12841</wfw:commentRss><description>Hello,&lt;br /&gt;&lt;br /&gt;unfortunately I had to recognize that I can´t bind a "Rich text control" to a data field in a secondary datasource.&lt;br /&gt;&lt;br /&gt;Actually I have a "ntext" data field in my "SQL Server 2005" database with "rich text formatted" data in it.&lt;br /&gt;&lt;br /&gt;Can anyone show me if there is a way that I can load the "rich text formatted" data in a RTF control in my form with script or even with manged code.&lt;br /&gt;&lt;br /&gt;I have tried many ways but all without success.&lt;br /&gt;&lt;br /&gt;A small sample how I can handle the rtf control in script code or even in managed code would be really appreciated.&lt;br /&gt;&lt;br /&gt;Thank you very much for any help.</description></item></channel></rss>