public static xrefTypeObj fromXml(xrefPageObj page, XElement root, Dictionary<string, docProp> propDir) { xrefTypeObj res = new xrefTypeObj { type = LowUtils.toCammelCase(root.Name.LocalName), page = page }; res.props = root.Attributes().SelectMany(attr => xrefPropObj.fromXml(res, attr)).Where(xp => fillOrigin(xp, propDir)).ToArray(); if (res.props.Length == 0) res.props = null; return res; }
public static xrefPageObj fromXml(string url, XElement root, Dictionary<string, docProp> propDir, sitemap smap) { xrefPageObj res = new xrefPageObj { url = url }; data sm; if (smap.TryGetValue(url, out sm)) res.sitemapParents = sm.parents(false).Select(p => p.uniqId).ToArray(); var tit = root.Descendants("title").FirstOrDefault(); res.title = tit == null ? null : tit.Value; res.types = root.DescendantsAndSelf().Where(el => !ignTags.Contains(el.Name.LocalName)).Select(el => xrefTypeObj.fromXml(res, el, propDir)).ToArray(); if (res.types.Length == 0) res.types = null; return res; }