Beispiel #1
0
        public static XmlAttributeSyntax WithPrefixName(this XmlAttributeSyntax attribute, string prefixName)
        {
            var existingName   = attribute.NameNode;
            var existingPrefix = existingName.PrefixNode;
            var newName        = SyntaxFactory.XmlNameToken(prefixName, null, null);

            return(attribute.WithName(existingName.WithPrefix(existingPrefix.WithName(newName))));
        }
Beispiel #2
0
        public static XmlAttributeSyntax WithLocalName(this XmlAttributeSyntax attribute, string localName)
        {
            var existingName      = attribute.NameNode;
            var existingLocalName = existingName.LocalNameNode;
            var newName           = SyntaxFactory.XmlNameToken(localName, null, null);

            return(attribute.WithName(existingName.WithLocalName(newName)));
        }