extracting only elements with text (or value)
Posted
by guy
on Stack Overflow
See other posts from Stack Overflow
or by guy
Published on 2010-03-28T08:56:55Z
Indexed on
2010/03/28
9:03 UTC
Read the original article
Hit count: 256
hay all. i am trying to transform html to xml meaning extracting all elements with text using this code is not working maybe some one has the answer ?
System.Xml.Linq.XElement query1 = new System.Xml.Linq.XElement("RawHTMLData",
from q in hDoc.Descendants("TABLE")
where q.HasElements
select new System.Xml.Linq.XElement("TABLE" + (++i).ToString(),
from j in q.Elements("TR")
where j.HasElements && j.Descendants("div") != null
select new System.Xml.Linq.XElement("Row",
from hh in j.Descendants("div")
where tt => j.Descendants("div").Contains(hh.Value)
select(TT(hh)))));
© Stack Overflow or respective owner