private static EpubNavigationDocTitle ReadNavigationDocTitle(XElement docTitleNode) { EpubNavigationDocTitle result = new EpubNavigationDocTitle(); foreach (XElement textNode in docTitleNode.Elements()) { if (String.Compare(textNode.Name.LocalName, "text", StringComparison.OrdinalIgnoreCase) == 0) { result.Add(textNode.Value); } } return(result); }
private static EpubNavigationDocTitle ReadNavigationDocTitle(XmlNode docTitleNode) { EpubNavigationDocTitle result = new EpubNavigationDocTitle(); foreach (XmlNode textNode in docTitleNode.ChildNodes) { if (String.Compare(textNode.LocalName, "text", StringComparison.OrdinalIgnoreCase) == 0) { result.Add(textNode.InnerText); } } return(result); }
private static async Task <EpubNavigationDocTitle> ReadNavigationDocTitleAsync(XmlReader reader) { EpubNavigationDocTitle result = new EpubNavigationDocTitle(); bool titleFound = await reader.ReadToFollowingAsync("docTitle", "http://www.daisy.org/z3986/2005/ncx/"); if (!titleFound) { throw new Exception("EPUB parsing error: title section not found in the .toc file."); } while (await reader.ReadAsync() && !(reader.NodeType == XmlNodeType.EndElement && reader.LocalName == "docTitle")) { if (reader.LocalName.ToLowerInvariant() == "text") { result.Add(reader.ReadElementContentAsString()); } } return(result); }
private static async Task<EpubNavigationDocTitle> ReadNavigationDocTitleAsync(XmlReader reader) { EpubNavigationDocTitle result = new EpubNavigationDocTitle(); bool titleFound = await reader.ReadToFollowingAsync("docTitle", "http://www.daisy.org/z3986/2005/ncx/"); if (!titleFound) throw new Exception("EPUB parsing error: title section not found in the .toc file."); while (await reader.ReadAsync() && !(reader.NodeType == XmlNodeType.EndElement && reader.LocalName == "docTitle")) { if (reader.LocalName.ToLowerInvariant() == "text") { result.Add(reader.ReadElementContentAsString()); } } return result; }
private static EpubNavigationDocTitle ReadNavigationDocTitle(XmlNode docTitleNode) { EpubNavigationDocTitle result = new EpubNavigationDocTitle(); foreach (XmlNode textNode in docTitleNode.ChildNodes) if (String.Compare(textNode.LocalName, "text", StringComparison.OrdinalIgnoreCase) == 0) result.Add(textNode.InnerText); return result; }