I am working on a mobile application and have to read a xml feed and parse the information. There it has a special tag as this <dc:creator> Jonethon Owens </dc:creator>
In C# I am using LINQ to XML and don't know how to exactly deal with this type of a tag to parse and get the information.
If someone can explain how to achieve this, really appreciated. Thanks in Advance
The colons indicate that those elements are in the ns1 namespace. This is needed when you are using multiple schemas. Assuming the document only uses ns1, it is essentially equivalent to not having any "ns1:" in those tags.
The XML document must have start-tag, so first starting tag is known as root tag. The opening tag started with < bracket followed by tag name or element name and close with > bracket.
XML (Extensible Markup Language) is a markup language similar to HTML, but without predefined tags to use.
You need the namespace prefix.
XNamespace dc = "http://purl.org/dc/elements/1.1/";
var query = from lst in XElement.Load(@"foo.xml").Elements(dc +"creator")
select ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With