<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE repub SYSTEM "C:\repub\Repub_V1.dtd"> <?xml-stylesheet href="C:\repub\repub.xsl" type="text/xsl"?> <repub> <head> <title>xxx</title> </head> <body> <sec> <title>First Title</title> <break name="1-1"/> <h1><page num="1"/>First Heading</h1> <bl>This is another text</bl> <fig><img src="images/img_1-1.jpg" alt=""/><fc>This is a caption</fc></fig> <p>This<br/> again is<br/> a paragraph</p> </sec> </body> </repub>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE repub SYSTEM "C:\repub\Repub_V1.dtd"> <?xml-stylesheet href="C:\repub\repub.xsl" type="text/xsl"?> <repub> <head> <title>xxx</title> </head> <body> <sec> <title>First Title</title> <break name="1-1"/> <h1><page num="1"/>First Heading</h1> <bl>This is another text</bl> <fig><img src="images/img_1-1.jpg" alt=""/><fc>This is a caption</fc></fig> <p>This</p> <p>again is</p> <p>a paragraph</p> </sec> </body> </repub>
foreach (var item in xdoc.Descendants("p")) { if (item.Elements("br").Count() > 0) { foreach (var br in item.Elements("br")) { //Do something } } }
XDocument
Load
Illegal characters in the path
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)