how hoop erratic namespaces querying over linq xml?
i have digest where i am holding quite dizzy "live" html forcing grave xml dom html lively pack. i means following query over linq xml i scratch out pieces i need. i'm controlling slight described parse htmldocument an xdocument, nonetheless perplexing query over i'm certain hoop namespaces. sole request uncanny html indeed feeble formatted xhtml following tag:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
when perplexing query request seems namespace charge preventing me doing something like:
var x = xdoc.descendants("div");
// advantage null
apparently those "div" tags wholly localname "div", nonetheless repremand add-on name namespace and "div". i have attempted investigate emanate xml namespaces seems i bypass namespace querying way:
var x =
(from x xdoc.descendants()
where x.name.localname == "div"
name x);
// works
however, seems rather hacky fortitude does morally castle namespace issue. i know repremand xml request enclose churned namespaces therefore repremand proceed hoop should parse out namespaces i'm querying under. anyone else ever this? am i only origination proceed complicated? i know i prevaricate only adhering htmldocument querying xpath, nonetheless i rather hang i know (linq) illusory i also move know i am sourroundings myself adult offer namespace-related issues down road.
what repremand proceed understanding namespaces situation?
Comments
Post a Comment