Are you blogging on PH? Get your free blog.
*/

Other Views

corner
*/

XML FAQ - Testing Whether an Attribute Exists in a Document

How do you test if an attribute exists in the xml document?

 
String Value="";
if (Node.Attributes["Attribute1"] == null)
{
    // doesn't exist
	Value="";
}
else
{
    // exists
	Value=Node.Attributes["Attribute1"].Value.ToString();
}


Back to XML FAQ
corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.
Resource Listings