469,625 Members | 1,595 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

InnerXml

hello,

i despair on one simple problem (maybe it's to simple???)

I have the string txt = "hallo</hmm>" or txt = "am&24"

and want to pass it to the XmlNode InnerXml property

myNode.InnerXml = txt //error

----------------------------------------------------------

how can i transform that string to a valid value. i searched thru all
classes and maybe i'm to blind...

hope some understand and can help

mm
Nov 11 '05 #1
3 3736
If you are going to set InnerXml, it must be valid xml.

If you just want to store the value, call InnerText

Joe Feser

"Martin Madreza" <ma*********@yahoo.de> wrote in message
news:f4**************************@posting.google.c om...
hello,

i despair on one simple problem (maybe it's to simple???)

I have the string txt = "hallo</hmm>" or txt = "am&24"

and want to pass it to the XmlNode InnerXml property

myNode.InnerXml = txt //error

----------------------------------------------------------

how can i transform that string to a valid value. i searched thru all
classes and maybe i'm to blind...

hope some understand and can help

mm

Nov 11 '05 #2
thanks!

One question. Before I found a solution:

xmlNode.AppendChild(xmlDocument.CreateTextNode(txt ));

is this a worser, slower approach or equal?

mm
Nov 11 '05 #3
Well it will work because you are adding text and not Xml.

It is really no different than just setting the xmlNode.InnerText Property.

Maybe someone from the team could answer, I personally just set InnerText

Joe Feser

"Martin Madreza" <ma*********@yahoo.de> wrote in message
news:f4**************************@posting.google.c om...
thanks!

One question. Before I found a solution:

xmlNode.AppendChild(xmlDocument.CreateTextNode(txt ));

is this a worser, slower approach or equal?

mm

Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Philipp Lenssen | last post: by
3 posts views Thread by Bas Jaburg | last post: by
1 post views Thread by ALI-R | last post: by
2 posts views Thread by =?Utf-8?B?c2VlbWE=?= | last post: by
4 posts views Thread by =?Utf-8?B?TWFyaw==?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.