Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

DTD must be defined

$
0
0

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?

In addition, if it helps, when i read the XML my code for that is
Dim Xdoc As XDocument = XDocument.Load(UrlToXml)

Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>