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

Convert XComment to XElement

$
0
0

Hi.

I have an XML Document with an structure like this:

<Elements>
    <Element>
        <value1 key="key1" value="value1">
        <value2 key="key2" value="value2">
    </Elemnet>
    <Element>
        <value3 key="key3" value="value3">
        <!-- <value4 key="key4" value="value4"> -->
    </Elemnet>
</Elemnts>

What i need is to convert the XComment of value 4 to an XElement and Vice Versa from C# Code.

How can i achieve this?

I now i can take the comment, format string, delete comment and add an Element.

Any other way?

Thanks a lot


Viewing all articles
Browse latest Browse all 935

Trending Articles



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