Exemplo n.º 1
0
 private static string GetNamespaceCore(DomElement element, string prefix)
 {
     if (string.IsNullOrEmpty(prefix))
     {
         return(element.Attribute("xmlns"));
     }
     return(element.Attribute("xmlns:" + prefix));
 }
Exemplo n.º 2
0
        public static DomElement SetDefaultXmlns(this DomElement self, DomNamespace ns)
        {
            if (self is null)
            {
                throw new ArgumentNullException(nameof(self));
            }

            return(self.Attribute("xmlns", ns));
        }
Exemplo n.º 3
0
 void CopyAttributes(XmlReader reader, DomElement element)
 {
     if (reader.HasAttributes && reader.MoveToFirstAttribute())
     {
         do
         {
             element.Attribute(reader.Name, reader.Value);
         } while(reader.MoveToNextAttribute());
         reader.MoveToElement();
     }
 }
Exemplo n.º 4
0
 public static DomElement SetXmlns(this DomElement self, string prefix, DomNamespace ns)
 {
     if (self is null)
     {
         throw new ArgumentNullException(nameof(self));
     }
     if (ns is null)
     {
         throw new ArgumentNullException(nameof(ns));
     }
     if (string.IsNullOrEmpty(prefix))
     {
         throw new NotImplementedException();
     }
     return(self.Attribute($"xmlns:{prefix}", ns));
 }