Hi, I have a problem with creating an XML tree, I'm starting but I would like you to paint this line at the beginning "" "" "", if you can also close it but only read the "UBLExtensions" but not the ext: and when I put it as a string variable to paint everything, I get an error that can not paint the characters. Someone who has a PDF or someone has the solution to this?
//ENCABEZADO DEL XML
string linea1 = "<ext:UBLExtensions>" +
"<ext:UBLExtension>" +
"<ext:ExtensionContent>" +
"<ds:Signature Id=\"signatureKG\">" +
"<ds:SignedInfo>" +
"<ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n20010315#WithComments\"/>" +
"<ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\"/>" +
"<ds:Reference URI=\"\">" +
"<ds:Transforms>" +
"<ds:Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#envelopedsignature\"/>" +
"</ds:Transforms>" +
"<ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"/>" +
"<ds:DigestValue>+pruib33lOapq6GSw58GgQLR8VGIGqANloj4EqB1cb4=</ds:DigestValue>" +
"</ds:Reference>" +
"</ds:SignedInfo>" +
"<ds:SignatureValue> AQUI VA LA SIGNATURA</ ds:SignatureValue > " +
"<ds:KeyInfo>" +
"<ds:X509Data>" +
"<ds:X509Certificate> FIRMA </ds:X509Certificate>" +
"</ds:X509Data>" +
"</ds:KeyInfo>" +
"</ds:Signature>" +
"</ext:ExtensionContent>" +
"</ext:UBLExtension>" +
"</ext:UBLExtensions>";
XmlDocument doc = new XmlDocument();
XmlElement raiz = doc.CreateElement("ext",":","UBLExtension");
doc.Save("D:\CodeDesign\archivo.xml");
I would like the result to come out like this.
"<ext:UBLExtensions>" +
"<ext:UBLExtension>" +
"<ext:ExtensionContent>" +
"<ds:Signature Id=\"signatureKG\">" +
"<ds:SignedInfo>" +
"<ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n20010315#WithComments\"/>" +
"<ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#dsa-sha1\"/>" +
"<ds:Reference URI=\"\">" +
"<ds:Transforms>" +
"<ds:Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#envelopedsignature\"/>" +
"</ds:Transforms>" +
"<ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"/>" +
"<ds:DigestValue>+pruib33lOapq6GSw58GgQLR8VGIGqANloj4EqB1cb4=</ds:DigestValue>" +
"</ds:Reference>" +
"</ds:SignedInfo>" +
"<ds:SignatureValue> AQUI VA LA SIGNATURA</ ds:SignatureValue > " +
"<ds:KeyInfo>" +
"<ds:X509Data>" +
"<ds:X509Certificate> FIRMA </ds:X509Certificate>" +
"</ds:X509Data>" +
"</ds:KeyInfo>" +
"</ds:Signature>" +
"</ext:ExtensionContent>"