Guest User

Untitled

a guest
Jan 22nd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. -<ds:Signature Id="Signature-15d7c3e9-a6b4-48be-a9a5-70cbef9dd03d" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
  2.  
  3. private string SetAtributo(XmlDocument xmlDoc,string prefix,string uri,string pathSintax,string atributo,string nuevoValor)
  4. {
  5. string result = "";
  6. try
  7. {
  8. xmlDoc.PreserveWhitespace = true;
  9. xmlDoc.Load(path);
  10. XmlNamespaceManager nsManager = new XmlNamespaceManager(xmlDoc.NameTable);
  11. nsManager.AddNamespace(prefix,uri);
  12. XmlNode nodo = xmlDoc.SelectSingleNode(pathSintax, nsManager);
  13. if (nodo != null)
  14. {
  15. //CODIGO QUE NECESITO
  16. }
  17. xmlDoc.Save(path);
  18. }
  19. catch (Exception ex) { result = ex.ToString(); }
  20. return result;
  21. }
  22.  
  23. private string SetAtributo(XmlDocument xmlDoc,string prefix,string uri,string pathSintax,string atributo,string nuevoValor)
  24. {
  25. string result = "";
  26. try
  27. {
  28. XmlNamespaceManager nsManager = new XmlNamespaceManager(xmlDoc.NameTable);
  29. nsManager.AddNamespace(prefix,uri);
  30. XmlNode nodo = xmlDoc.SelectSingleNode(pathSintax, nsManager);
  31. if (nodo != null)
  32. {
  33. nodo.Attributes[1].Value = nuevoValor;
  34. }
  35. }
  36. catch (Exception ex) { result = ex.ToString(); }
  37. return result;
  38. }
Add Comment
Please, Sign In to add comment