Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
xpath select element code
using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Xml; using System.Xml.Linq; using System.Xml.XPath; namespace Rextester { public class Program { public static void Main(string[] args) { string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?> <!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.1//EN"" ""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd""> <html xml:lang="""" xmlns=""""> <head> <title>De title</title> <link rel=""stylesheet"" type=""text/css"" href=""Digital.css""/> </head> <body> <h3 class=""sgc-5"">Blah Blah Blah<sup class=""fn-num""><a id=""r_fn1"" href=""#fn1"">1</a></sup></h3> <p class=""indent"">the quick brown fox jump over the lazy dog</p> </body> </html>"; XDocument xDoc = XDocument.Parse(xml); Console.WriteLine(xDoc.XPathSelectElement("//h3").Value); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
nums y lists
Full text search using Linqdb
SevenSevenSeven
Number Comparer
Animal generator (Under construction!)
7.2 Creating async methods the old way
C# - MD5Hash
Code_only_sin_xm
Swap 1
string.Format example
Please log in to post a comment.