Ok, I'm using XmlSerializer to serialize and deserialize an object to Xml.
Primarily, I am attempting to use the XmlSerializer.Deserialize method to
deserialize an RSS 1.0 (RDF) feed directly into a .NET object.
However, by the specification of the RSS 1.0 (RDF) format, the root element
of the Xml should be <rdf:RDF>.
I have tried everything with the .NET framework to create a .NET class that
will serialize or deserialize to Xml that can begins with a prefixed or
qualified root element such as <rdf:RDF>.
I can use the XmlElement tag to generate Xml elements with a prefix,
however, I cannot make this work for the root element. No combination of
XmlRootAttribute, XmlTypeAttribute, etc will serialize or deserialize Xml
files with a prefixed or qualified root element.
"John Saunders" wrote:
Quote:
"Hone" <Hone@discussions.microsoft.comwrote in message
news:27D11D1B-7D9F-40F2-A1F2-0C650802009D@microsoft.com...
Quote:
I'm trying to serialize/deserialize the XML for an RSS 1.0 Feed (i.e. RDF)
and the root element, as required by the standard, looks like this:
<rdf:RDF ...>
</rdf:RDF>
However, I've tried everything using XmlRootAttribute, XmlTypeAttribute,
XmlSerializerNamespacesAttribute, etc, and nothing will serialize to or
deserialize from this root element format.
I can get child elements to be prefixed by using the XmlElementAttribute
and
a namespace, but cannot achieve this with the root element, which is
required
to serialize and deserialize RDF documents.
How do you make this work?
>
It would help if you were to elaborate.
>
John
>
>
>