Calyptus.Lob.WebXlob.WebResponseXmlReader.GetParser C# (CSharp) Method

GetParser() private static method

private static GetParser ( WebResponse response ) : XmlParserContext
response System.Net.WebResponse
return System.Xml.XmlParserContext
			private static XmlParserContext GetParser(WebResponse response)
			{
				XmlParserContext context = new XmlParserContext(null, null, null, XmlSpace.Preserve);
				HttpWebResponse httpResponse = response as HttpWebResponse;
				if (httpResponse != null && httpResponse.CharacterSet != null)
					try
					{
						context.Encoding = System.Text.Encoding.GetEncoding(httpResponse.CharacterSet);
					}
					catch
					{
					}
				context.BaseURI = response.ResponseUri.ToString();
				return context;
			}
		}