Visual Basic (Declaration) | |
---|---|
Public Overloads Sub WriteXml( _ ByVal wtr As TextWriter _ ) |
C# | |
---|---|
public void WriteXml( TextWriter wtr ) |
Parameters
- wtr
Library/Library.Test/TestHtmlParser.cs
C# | Copy Code |
---|---|
XmlLightDocument doc = new HtmlLightDocument(document); XmlLightDocument doc2; using (TempFile t = new TempFile()) { using (TextWriter tw = new StreamWriter(t.Open())) doc.WriteXml(tw); new XhtmlValidation(XhtmlDTDSpecification.XhtmlTransitional_10).Validate(t.TempPath); doc2 = new XmlLightDocument(t.ReadAllText()); Assert.AreEqual(doc.InnerXml, doc2.InnerXml); } |
VB.NET | Copy Code |
---|---|
Dim doc As XmlLightDocument = New HtmlLightDocument(document) Dim doc2 As XmlLightDocument Using t As New TempFile() Using tw As TextWriter = New StreamWriter(t.Open()) doc.WriteXml(tw) End Using New XhtmlValidation(XhtmlDTDSpecification.XhtmlTransitional_10).Validate(t.TempPath) doc2 = New XmlLightDocument(t.ReadAllText()) Assert.AreEqual(doc.InnerXml, doc2.InnerXml) End Using |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
XmlLightElement ClassXmlLightElement Members
Overload List