When running this VB.net, I get the error "Data at the root level is invalid. Line 1, position 1" when reaching line 3 where it adds the RDF namespace to the Schemaset.
Dim doc As New XmlDocument()
Dim xss As New XmlSchemaSet()
xss.Add("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
doc.Schemas = xss
Dim rdf As XmlElement = doc.CreateElement("rdf:RDF")
rdf.SetAttribute("xmlns", "http://purl.org/rss/1.0/")
doc.AppendChild(rdf)
Debug.WriteLine(doc.ToString)
I am looking for a way to produce the example code for craiglist bulk posting but have had no luck finding .net examples. I am willing to use XML or an RDF library but just can't find good examples of how to create a root element with a colon in it. I found that the above code might be failing because of a .net bug that doesnt permit cdata in the schemaset. Not sure if that is true.
https://www.craigslist.org/about/bulk_posting_interface
<?xml version="1.0"?>
<rdf:RDF xmlns="http://purl.org/rss/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cl="http://www.craigslist.org/about/cl-bulk-ns/1.0">
<channel>
<items>
<rdf:li rdf:resource="NYCBrokerHousingSample1"/>
<rdf:li rdf:resource="NYCBrokerHousingSample2"/>
</items>
<cl:auth username="listuser@bogus.com"
password="p0stp@rty"
accountID="14"/>
</channel>
...