Quantcast
Channel: htmlagilitypack Forum Rss Feed
Viewing all articles
Browse latest Browse all 450

New Post: Selecting node based on attribute / removing unknown attributes

$
0
0
Hi all ,

"How can we select all the nodes which does not have the specified list of attributes'
                                     OR in other words i can say 
"How can i remove the unwanted attributes

Eg: i have tags say <div><p> and <img>
<div> and <p> tag can have the following attributes
        1)id
        2)styleName
        3)typeName
and <img> can have the follwoing
                     1)source
                     2)alt
                     3)id
                     4)typeName
                     5)styleName
How can i remove if there are any other attributes?


I tried htmldoc.DocumentNode.SelectNodes("//*[not(@id | @styleName | @typeName |@source | @alt)]");

but it is not working as per my need?

Any help will be appriciated!

Viewing all articles
Browse latest Browse all 450

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>