Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

The tag is being removed when I update the Inner Text

$
0
0

I am trying to go into a specific node and update the <Sql> tag.

I can update the inner text, but then it is leaving off the <Sql> tag which is then causing the Query to not be there.

What am I doing wrong?

  foreach (XmlNode item in nodes)
                        {
                            if (item != null)
                            {
                                if (item.FirstChild != null)
                                {
                                    if (string.IsNullOrWhiteSpace(item.FirstChild.Name) == false)
                                    {
                                        if (item.FirstChild.Name == "Sql")
                                        {
                                            item.InnerText = await serviceQueryFilter.InjectOrganizationFilter(userId, Id, item.InnerText).ConfigureAwait(false);

                                            item.InnerText = "<Sql>" + item.InnerText + "</Sql>"; // This is wrong, but after updating the text how do I re apply the <Sql></Sql>
                                        }
                                    }
                                }
                            }
                        }


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>