Close() 공개 메소드

Closes the writer and retrieves the created XPathDocument.
public Close ( ) : XPathDocument
리턴 System.Xml.XPath.XPathDocument
		public void ShouldUseBaseUriForDocument()
		{
			XPathDocumentWriter writer = new XPathDocumentWriter("kzu-uri");
			writer.WriteStartElement("Foo");
			XPathDocument doc = writer.Close();

			Assert.IsNotNull(doc);
			Assert.AreEqual("kzu-uri", doc.CreateNavigator().BaseURI);
		}
		public void ShouldWriteRootElement()
		{
			XPathDocumentWriter writer = new XPathDocumentWriter();
			writer.WriteElementString("hello", "world");
			XPathDocument doc = writer.Close();

			Assert.IsNotNull(doc);

			string xml = GetXml(doc);

			Assert.AreEqual("<hello>world</hello>", xml);
		}
		public void WriterIsDisposable()
		{
			XPathDocument doc;
			using (XPathDocumentWriter writer = new XPathDocumentWriter())
			{
				writer.WriteElementString("hello", "world");
				doc = writer.Close();
			}

			Assert.IsNotNull(doc);
		}
		public void ShouldAcceptStartElementRootOnly()
		{
			XPathDocumentWriter writer = new XPathDocumentWriter();
			writer.WriteStartElement("Foo");
			XPathDocument doc = writer.Close();
		}
		public void ShouldThrowIfNoRootWritten()
		{
			XPathDocumentWriter writer = new XPathDocumentWriter();
			XPathDocument doc = writer.Close();
		}