I need to generate an xml with a somewhat complicated structure
First block:
<rule id="Main">
<item>
YO <ruleref uri="#Nombre" />
CON NUMERO DE TELEFONO CELULAR<ruleref uri="#Numero" />
EXPRESO MI VOLUNTAD<ruleref uri="#Voluntad" />
MI CUENTA INDIVIDUAL<ruleref uri="#Tramite" />
Y HAGO ENTREGA<ruleref uri="#Recibe" />
AL AGENTE PROMOTOR<ruleref uri="#Agente" />
CON NUMERO<ruleref uri="#Numero1" />
QUIEN ME PROPORCIONO<ruleref uri="#Propociono" />
DE LAS IMPLICACIONES<ruleref uri="#Implicaciones" /></item>
</rule>
<rule id="Nombre" scope="public">
<one-of>
<item>GERARDO TOLEDO SANCHEZ</item>
</one-of>
</rule>
Second block:
<rule id="Numero" scope="public">
<one-of>
<item>5566778899</item>
</one-of> </rule> <rule id="Voluntad" scope="public">
<one-of>
<item>DE TRANSPASAR</item>
</one-of> </rule>
With the second block I have no problem generating it:
XDocument miXML = XDocument.Load(pathDataFile); //Cargamos miXML.Root.Add( //Obtiene la raiz del documento (Empleados) new XElement("rule", new XAttribute("id", "Numero"), new XAttribute("scope", "public"), new XElement("one-of", new XElement("item", "5566778899")) )); miXML.Save(pathDataFile);
But I just can not make the first block generate, I tried assigning a new element within the text but it does not generate
Will they have any idea how to generate something similar? All help is welcome