1
I wonder how to convert a string
with XML
inline for a XML
with tags
, I’m using the XmlDocument
, I have the following code:
var MihaString="<MeuXML Info01="teste 0121245" Info02="2020-01-14" Info03="2019-12-30"/>";
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(MihaString);
var result = xmlDocument.OuterXml;
However even using Outerxml it maintains the same input xml structure.
Expected result would be something like this:
<MeuXMLPai>
<MeuXML>
<Info01> teste 0121245 </Info01>
<Info02> 2020-01-14 </Info02>
<Info03> 2019-12-30 </Info03>
</MeuXML>
</MeuXMLPai>
I don’t understand your doubt?
– novic
<Meuxmlpai> <Meuxml> <Info01> test 0121245 </Info01> <Info02> 2020-01-14 </Info02> <Info03> 2019-12-30 </Info03> </Meuxmlpai> </Meuxml>
– Luiz Lanza
Wanted to transform this xml:<Meuxmlpai> <Meuxml> <Info01> 0121245 test </Info01> <Info02> 2020-01-14 </Info02> <Info03> 2019-12-30 </Info03> </Meuxmlpai> </Meuxml>
– Luiz Lanza