Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/Tools/Tidy/Tidy HTML Tree
Required plugins for this example: MBS Tools Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Tools/Tidy/Tidy HTML Tree
This example is the version from Sun, 17th Mar 2012.
Project "Tidy HTML Tree.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control ef Inherits TextArea
ControlInstance ef Inherits TextArea
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() work End EventHandler
End Control
Control Listbox1 Inherits Listbox
ControlInstance Listbox1 Inherits Listbox
End Control
Private Sub ParseNode(node As TidyNodeMBS) While node <> nil dim s As String // for observing node content in the debugger s = node.Text Listbox1.AddRow s dim c As TidyNodeMBS = node.Child if c <> nil Then ParseNode c end if node = node.NextNode Wend End Sub
Private Sub Work() dim input As String = ef.Text if input = "" Then Beep Return end if dim t as TidyDocumentMBS t=new TidyDocumentMBS t.OptionXhtmlOut=True call t.ParseString(input) call t.CleanAndRepair 'call t.RunDiagnostics 't.OptionForceOutput=true dim s As String=t.SaveString dim n as TidyNodeMBS=t.Body while n<>nil ParseNode(n) n=n.NextNode wend End Sub
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Tools Plugin.

MBS Xojo tutorial videos