private Element GetDocumentBody(Element rootElement) { Element body = rootElement.GetFirstDescendantNamed("body"); if (body == null) { body = new Element("body"); rootElement.AppendChild(body); } return body; }
private string GetBreadcrumbWording(Element rootElement, Resource resource) { var title = rootElement.GetFirstDescendantNamed("title"); if (title != null && !String.IsNullOrEmpty(title.Text)) { return title.Text; } var headings = rootElement.GetDescendantElements("h1"); foreach (var h1 in headings) { if (h1 != null && !String.IsNullOrEmpty(h1.Text)) { return h1.Text; } } if (resource != null) { var heading = resource.Name; if (!String.IsNullOrEmpty(heading)) { heading = this.StripExtension(heading); heading = Capitalize(heading); heading = DeCamelCase(heading); return heading; } } return "(Up)"; }