I am trying to create an XML file. I created one using the below code
Dim XD As XDocument = <?xml version="1.0" encoding="UTF-8" standalone="no"?><Movies></Movies> For Each M in Movies XD.Root.Add(<Movie><Title><%= M.Title %></Title> ....</Movie>) Next
This worked great until i started receiving the error "DTD must be defined before the document root element", so set standalone to "no" (as above). This still hasnt resolved the issue.
When viewing the XML i noticed no declaration is present but i dont know if that would cause this issue or not?
Dim Xdoc As XDocument = XDocument.Load(UrlToXml)