Imports System
Imports System.Reflection
Imports System.Xml
Module Module1
Sub Main()
Dim xml As XElement = XElement.Load("People.xml")
Dim html As New XElement("HTML", _
New XElement("BODY", _
New XElement("TABLE", _
New XElement("TH", "ID"), _
New XElement("TH", "Full Name"), _
New XElement("TH", "Role"), _
From p In xml.Descendants("person"), r In xml.Descendants("role") _
Where p.Element("idrole").Value = r.Element("id").Value _
Select New XElement("TR", _
New XElement("TD", p.Element("id").Value), _
New XElement("TD", p.Element("firstname").Value _
& " " & p.Element("lastname").Value), _
New XElement("TD", r.Element("roledescription").Value)))))
html.Save("People.html")
End Sub
End Module
|