Questions tagged [xmlattributecollection]

6 questions
21
votes
1 answer

How can I check if an attribute exist in XmlAttributeCollection?

I was checking XmlNode.Attributes topic on MSDN about methods for checking if a XmlNode an attribute exists given its name. Well, there is no sample on how to check an item. I have something like: //some code here... foreach (XmlNode node in…
Junior Mayhé
  • 16,144
  • 26
  • 115
  • 161
4
votes
1 answer

How to write LINQ statement for XmlAttributeCollection?

I always confuse AsQueryable, AsEnumerable. When should I use them? Should I use AsQueryable to create a LINQ statement to make a filter according to attribute of xml or AsEnumerable? [Serializable] public class LogHandler :…
uzay95
  • 16,052
  • 31
  • 116
  • 182
1
vote
0 answers

PropertyGrid BrowsableAttributes Bug?

This seems like a bug: the code below works fine: this.propertyGrid1.SelectedObject = new Button(); the code below doesn't: this.propertyGrid1.BrowsableAttributes = new AttributeCollection( new…
Kendo Wang
  • 51
  • 1
  • 3
0
votes
2 answers

C# How to use Linq on an XmlAttributeCollection within another Linq statement?

I have an XML element with subelements like so: I'm using an already existing method MyMethod() to fetch the Groups element…
Ivan Ivković
  • 417
  • 3
  • 14
0
votes
1 answer

Adding XmlAttribute to XmlAttributeCollection

I want to create an XmlAttributeCollection and add some attributes depending on conditions. This is what I've tried. XmlElement fishElement = doc.CreateElement(string.Empty, "fi", string.Empty); XmlAttributeCollection attCollection =…
Ghasem
  • 14,455
  • 21
  • 138
  • 171
0
votes
1 answer

GetNamedItem() vs. index

Is there a difference between method GetNamedItem("test") and access by index in XmlAttributeCollection? Maybe in null handling or in something else? xml_node.Attributes.GetNamedItem("test").Value; xml_node.Attributes["test"].Value;
benderto
  • 896
  • 11
  • 39