Getting the underlying XML of a rich text field in InfoPath - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Getting the underlying XML of a rich text field in InfoPath

Last post 09-10-2009 10:20 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-09-2009 02:43 PM

    Getting the underlying XML of a rich text field in InfoPath

    I have a rich text field in my InfoPath 2003 form. The form field displays the formatted text. What I need, though, is the underlying node's text that contains the HTML markup for the formatting. How can I retrieve the complete node text for my rich text field?

    We are publishing to a forms library in MOSS 2007 and the rich text is changed to plain text. I want to pass the HTML formatting in a field so we can reconstruct the rich test in a SharePint Designer dataview.

     

    Thanks in advance for any help you can offer. My INfoPath scripting is in VBScript.

    Leon Bryant
    Filed under: ,
  • 09-10-2009 09:42 AM In reply to

    Re: Getting the underlying XML of a rich text field in InfoPath

    Hi, again --

    In your other post on this, you didn't mention what version of IP you were using. I'm afraid I'm not terribly VBScript savvy, but for C# for the IP 2003 object model:

    IXMLDOMNode node = thisXDocument.DOM.selectSingleNode("/my:myFields/my:temp");
    IXMLDOMNodeList children = node.childNodes;
    string innerXml = string.Empty;
    foreach (IXMLDOMNode child in children)
    {     
       
    innerXml += child.xml;

    }
    Hilary Stoupa

  • 09-10-2009 09:56 AM In reply to

    Re: Getting the underlying XML of a rich text field in InfoPath

    It's IP 2003. Does the C# code have to be written using Visual Studio in the .xsn file? For my general scripting I use VBScript. The only ither option I saw was JScript.

    Thanks for being patient with my very fundamental questions.

    Leon Bryant
  • 09-10-2009 10:20 AM In reply to

    Re: Getting the underlying XML of a rich text field in InfoPath

    If you are using IP 2003 and you want to use C#, I'm afraid you are going to have use Visual Studio. If you don't have Visual Studio, you can use InfoPath 2007 (if you have a copy) and set the language to be C# compatible for the 2003 object model. If you only have 2003, I'm afraid you'll need to try to find a way to accomplish the same thing, but in a scripting language. Since the object model is the same, it shouldn't be too hard to translate.

    Hilary Stoupa

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.