Decodes a name. This method does the reverse of the EncodeName and EncodeLocalName methods. : XML Convert « XML LINQ « C# / C Sharp






Decodes a name. This method does the reverse of the EncodeName and EncodeLocalName methods.

 

using System;
using System.IO;
using System.Xml;

public class Sample
{
  public static void Main()
  {
     string name1 = XmlConvert.EncodeName("Order Detail");
     Console.WriteLine("Encoded name: " + name1);
     Console.WriteLine("Decoded name: " + XmlConvert.DecodeName(name1));

     string name2 = XmlConvert.EncodeLocalName("a:book");
     Console.WriteLine("Encoded local name: " + name2);
     Console.WriteLine("Decoded local name: " + XmlConvert.DecodeName(name2));

  }
}

   
  








Related examples in the same category

1.Converts the supplied String to a DateTimeOffset equivalent.
2.Converts the DateTime to a String.
3.Converts the supplied DateTimeOffset to a String.
4.Converts the supplied DateTimeOffset to a String in the specified format.
5.Verifies that the name is a valid name according to the W3C Extended Markup Language recommendation.
6.Verify Xml Chars