BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


.NET and XML
How to Create a Comment with XmlDocument and XmlComment?
How to Read a XML from a Stream with XmlTextReader?
How to Read a XML from a URL with the XmlTextReader?
How to auto-increment an unique ID in XML with XmlTextReader?
How to read Nodes with XmlNodeReader?
How to Get the Attribute Value with XmlNodeReader and GetAttribute?
How to skip child nodes with XmlNodeReader and Skip?
How to convert the return value from XML with XmlConvert and ToInt32?
What is the 'pull model'?
What is EXSLT.NET?
What is ADO.NET?
How to create a ""hello world"" XML WebService in Visual Studio .NET?
Accessing and Manipulating XML Data in Microsoft .NET Framework
Developing Multi-Threaded .NET Applications


 
 

<< XSLT 


By Sonu Kapoor
First Posted 02/20/2005
Times viewed 194

How to use the Item property in XmlTextReader?


Summary How to use the Item property in XmlTextReader?

Like the GetAttribute method you can use the Item property get the attribute value from an XML element. The Item property can be used on the following forms:

  • Item[string]
  • Item[int]
  • Item[string, string]

The first method accepts the name of the attribute. The second one accepts an index starting with 0. The third one takes the name of the attribute and the namespace URI of the attribute. Here is a small example.

Output: Item with integer: 0 Item with string: 0 Item with integer: 1 Item with string: 1 Item with integer: 2 Item with string: 2 Item with integer: 3 Item with string: 3 Item with integer: 4 Item with string: 4

Additional information

Further additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< XSLT 





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML