This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,36 @@
using System.Xml;
namespace Kreta.EESZTInterface
{
public class XmlHelper
{
public const string EncryptedDataElementName = "EncryptedData";
public const string EncryptedKeyElementName = "EncryptedKey";
public const string SecurityElementName = "Security";
public const string RequestSecurityTokenElementName = "RequestSecurityToken";
public const string HeaderElementName = "Header";
public const string BodyElementName = "Body";
public const string SignatureElementName = "Signature";
public static XmlElement GetElement(string element, string elementNS, XmlElement doc)
{
var list = doc.GetElementsByTagName(element, elementNS);
return list.Count == 0 ? null : (XmlElement)list[0];
}
public static XmlElement GetElementId(XmlDocument doc, string id)
{
XmlElement idElem = null;
if (idElem == null)
{
XmlNamespaceManager nsManager = new XmlNamespaceManager(doc.NameTable);
nsManager.AddNamespace("wsu", Namespaces.wsuNs);
idElem = doc.SelectSingleNode("//*[@wsu:Id=\"" + id + "\"]", nsManager) as XmlElement;
}
return idElem;
}
}
}