Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
xpath select element code
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
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); } } }
Show compiler warnings
[
+
]
Show input
Compilation time: 0.17 sec, absolute running time: 0.22 sec, cpu time: 0.23 sec, average memory usage: 21 Mb, average nr of threads: 4
fork mode
|
history
|
discussion
Blah Blah Blah1