Пример #1
0
        private void VerifyXPath()
        {
            string Xpath = mAction.ElementLocateValue;

            try
            {
                XPathParser <XElement> xpp = new XPathParser <XElement>();
                XElement xe1 = xpp.Parse(Xpath, new XPathTreeBuilder());
                xpp.GetOKPath();

                XElement xe = new XPathParser <XElement>().Parse(Xpath, new XPathTreeBuilder());

                XmlWriterSettings ws = new XmlWriterSettings();
                {
                    ws.Indent             = true;
                    ws.OmitXmlDeclaration = true;
                }
                StringBuilder sb = new StringBuilder();
                using (XmlWriter w = XmlWriter.Create(sb, ws))
                {
                    xe.WriteTo(w);
                }

                ResultLabel.Content = sb.ToString();
            }
            catch (Exception e)
            {
                ResultLabel.Content = e.Message;
            }
        }