This project has moved. For the latest updates, please go here.
1

Closed

Cannot deserialize Xml because: Prefix "xmlns" is reserved for use by XML

description

Using RDFSharp on the publicly available Url: http://meltwaternews.com/magenta/xml/html/12/93/rss/v2_445947_hitsentence.rss.XML generates the following error:

Cannot deserialize Xml because: Prefix "xmlns" is reserved for use by XML

I did some digging around and as it turns out that the prefix can not be equal to the values "xml" or "xmlns" as per the M$ document @ http://msdn.microsoft.com/en-us/library/bb531445(v=vs.90).aspx

I worked around this issue by making the following changes to the RDFNamespace.cs file.
On lines 54 and 78 where the statement this.Prefix = prefix; is located, I modified both lines to read:

this.Prefix = (prefix == "xml" || prefix == "xmlns") ? string.Empty : prefix;

This fixed my error, and I am now able to read the rdf file just fine.

Without being too intimate with the code base, can this change have lingering effect that I am not aware of or unable to detect at this point in time?

Thanks for the great code!
Closed Sep 20, 2014 at 6:59 PM by mdesalvo
Issue is fixed in both 0.6.x and 0.7.x codebase.

It will be delivered with RDFSharp-0.6.10.7 maintenance release, planned for Dicember.

comments

mdesalvo wrote Sep 17, 2014 at 10:30 PM

Dear user RogueCode,
thank you very much for using RDFSharp and having found this evidence.

I'll analyze this as soon as possible and will let you know. Your help is welcome :)

Regards,
Marco De Salvo

wrote Sep 17, 2014 at 10:32 PM

wrote Sep 20, 2014 at 6:59 PM

wrote Sep 20, 2014 at 6:59 PM

wrote Mar 1, 2016 at 9:24 AM