TagEncode() public static method

public static TagEncode ( string xmlTag ) : string
xmlTag string
return string
示例#1
0
 private static string EncodedPath(ProfilePath path)
 {
     string[] paths = new string[path.Length];
     for (int i = 0; i < path.Length; i++)
     {
         paths[i] = XmlNormalizer.TagEncode(path[i]);
     }
     return(string.Join("/", paths));
 }
示例#2
0
            public void AddValue(ProfilePath path, string value)
            {
                XmlNode rootnode = _document.DocumentElement;

                foreach (string name in path)
                {
                    XmlNode node = null;
                    string  n    = XmlNormalizer.TagEncode(name);
                    node = rootnode.SelectSingleNode(n);
                    if (node == null)
                    {
                        node = _document.CreateElement(n);
                        rootnode.AppendChild(node);
                    }
                    rootnode = node;
                }
                XmlAttribute attrib = _document.CreateAttribute("value");

                rootnode.Attributes.Append(attrib);
                attrib.Value = value;
            }