Get the string of an XML node - InfoPath Dev
in

InfoPath Dev

Get the string of an XML node

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

    Get the string of an XML node

     

    The XML node contains this string, which is created by a rich text field named 'Message':

    <my:Message>

    And here is my <strong xmlns="http://www.w3.org/1999/xhtml"><em>proposed </em></strong>message. Don't even consider changing a <strong xmlns="http://www.w3.org/1999/xhtml"><font color="#ff0000">word</font></strong>!

    </my:Message

    Which displays the formatted text: "And here is my proposed message. Don't even consider changing a word!"

    How can I extract the full string from the node that contains all of the formatting markup? When this field is written to a forms library, the rich text is passed as plain text.

     

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

    Re: Get the string of an XML node

    Hi: You can get the value with the markup with code -- the InnerXml property of an XPathNavigator will return a string with the markup. However, I don't know that SharePoint would know what to do with it if you were able to promote it -- if you promote a text field, for example, with the string with markup, it will display the string with the markup, it doesn't display it as formatted text.

    Hilary Stoupa

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

    Re: Get the string of an XML node

    Thanks Hillary. I appreciate you taking the time to respond. Here's our situation. We are using a SharePoint 2007 forms library based on an InfoPath 2003 form. The form has a rich text field for formatted text. The forms library then feeds a dataview on a web part page. We really need to display this particular field as rich text with bolding, hyperlinks, lists, etc.

    Unfotunately, when the form is submitted, the rich text field is passed as plain text. I was hoping that, if we can get the markup from the node, we could somehow render that in the dataview.

    From what you saying this may not be possible, right? If not, how could we accomplish this? Is there any way to make the forms library field a true rich text field?

    Thanks again!

     

     

     

     

     

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

    Re: Get the string of an XML node

    Well, I don't know if your markup could be rendered in a dataview or not. Perhaps someone who is more familiar with SharePoint than I am will be able to address that question.

    For the sake of organization, here's the link to your other post on this.

    Hilary Stoupa

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