No matter what I try I am unable to parse this xml with linq and get the full-path value:
You can use the XDocument.Load
static method in order to read the full-path
value easily, but don't forget to use the element
namespace as a prefix:
var zip = ZipFile.Open(file.FullName, ZipArchiveMode.Read);
var info = zip.GetEntry("META-INF/container.xml");
var doc = XDocument.Load(info.Open());
XNamespace ns = "urn:oasis:names:tc:opendocument:xmlns:container";
var element = doc.Descendants(ns+"rootfile").FirstOrDefault();
if(element != null)
{
var fullPath = element.Attribute("full-path").Value;
}
You have a namespace, you need to specify it with your element name:
XNamespace ns = "urn:oasis:names:tc:opendocument:xmlns:container";
var rootFiles = xml.Descendants(ns + "rootfile");