Exemplo n.º 1
0
 public override void Do()
 {
     this.p = xe.ParentNode; // in case a prior command changed this!
     XmlAttribute a = null;
     if (autoGenPrefixes && XmlHelpers.MissingNamespace(name)) {
         a = XmlHelpers.GenerateNamespaceDeclaration(xe, name);
     }
     this.ne = xe.OwnerDocument.CreateElement(name.Prefix, name.LocalName, name.NamespaceUri);
     Redo();
     if (a != null) {
         xmlns = new InsertNode(node, InsertPosition.Child, a, false, false);
         xmlns.Do();
     }
 }
Exemplo n.º 2
0
 public override void Do()
 {
     XmlAttribute nsa = null;
     this.p = this.a.OwnerElement; // just in case a prior command changed this!
     if (autoGenPrefixes && XmlHelpers.MissingNamespace(name)) {
         nsa  = XmlHelpers.GenerateNamespaceDeclaration(this.p, name);
     }
     this.na = a.OwnerDocument.CreateAttribute(name.Prefix, name.LocalName, name.NamespaceUri);
     this.na.Value = this.a.Value; // todo: copy children properly.
     Redo();
     if (nsa != null) {
         xmlns = new InsertNode(node, InsertPosition.After, nsa, false, false);
         xmlns.Do();
     }
 }