OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   re: [xml-dev] counting attributes

[ Lists Home | Date Index | Thread Index ]

Avinash Subramanya writes:

 > How do I get a count of the number of attributes of an element?
 > 
 > ex:
 > <Property prop1="val1" prop2="val2" />
 > 
 > Count should give me 2.

In SAX, under Java, use the Attributes.getLength() method.

In DOM, under Java, use the NamedNodeMap.getLength() method.

There are, of course, many, many other interfaces for many other
languages.  What, exactly, did you have in mind?


All the best,


David

-- 
David Megginson, david@megginson.com, http://www.megginson.com/




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS