Bloom.Book.HtmlDom.SafeSelectNodes C# (CSharp) Method

SafeSelectNodes() public method

public SafeSelectNodes ( string xpath ) : XmlNodeList
xpath string
return System.Xml.XmlNodeList
        public XmlNodeList SafeSelectNodes(string xpath)
        {
            return RawDom.SafeSelectNodes(xpath);
        }

Usage Example

Example #1
0
        public static void CopyImageMetadataToWholeBook(string folderPath, HtmlDom dom, Metadata metadata, IProgress progress)
        {
            progress.WriteStatus("Starting...");

            //First update the images themselves

            int completed = 0;
            var imgElements = GetImagePaths(folderPath);
            foreach (string path in imgElements)
            {
                progress.ProgressIndicator.PercentCompleted = (int)(100.0 * (float)completed / imgElements.Count());
                progress.WriteStatus("Copying to " + Path.GetFileName(path));
                using (var image = PalasoImage.FromFile(path))
                {
                    image.Metadata = metadata;
                    image.SaveUpdatedMetadataIfItMakesSense();
                }
                ++completed;
            }

            //Now update the html attributes which echo some of it, and is used by javascript to overlay displays related to
            //whether the info is there or missing or whatever.

            foreach (XmlElement img in dom.SafeSelectNodes("//img"))
            {
                UpdateImgMetdataAttributesToMatchImage(folderPath, img, progress, metadata);
            }
        }
All Usage Examples Of Bloom.Book.HtmlDom::SafeSelectNodes