XML and ASP.Net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • StevieMars
    New Member
    • Mar 2010
    • 21

    #1

    XML and ASP.Net

    I have to create XML on the fly and the inner text of an element needs to have a <br/> in it like :

    <ElementName>So meText <br/> Some more text </ElementName>

    if I try:
    ElementName.Inn erText = SomeText <br/> Some more text ;
    the < and > get encoded and it doesn't work.

    I have tried Creating a br node using the createnode method but this puts the <br/> at the end of the text rather than in where I want it.

    Any ideas on the best way to do this?

    And I'm not able to use cData due to the XML spec that I'm working to.
  • StevieMars
    New Member
    • Mar 2010
    • 21

    #2
    ok ignore that...

    XMLDocument.Cre ateTextNode("So meText");
    XMLDocument.Cre ateElement("br" );
    XMLDocument.Cre ateTextNode("So meMoreText");

    and append them in that order worked.

    Comment

    • ThatThatGuy
      Recognized Expert Contributor
      • Jul 2009
      • 453

      #3
      Originally posted by StevieMars
      ok ignore that...

      XMLDocument.Cre ateTextNode("So meText");
      XMLDocument.Cre ateElement("br" );
      XMLDocument.Cre ateTextNode("So meMoreText");

      and append them in that order worked.
      Are you replying to yourself

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by ThatThatGuy
        Are you replying to yourself
        Originally posted by ThatThatGuy
        Are you replying to yourself
        I'm pretty sure that StevieMars figured out the answer and posted it for everyone to see ;)

        Thanks for posting the answer StevieMars :)
        I'm sure it will help others with the same problem

        Comment

        Working...