Menu

#52 Please add access to XmlElement attributes

open
6
2008-10-22
2008-10-22
No

Please add some member functions to CppUnit::XmlElement, providing access to its attributes. Such member functions would be very helpful to me! Read-only access would be sufficient to me. (I would like to use XML to specify a custom selection of tests, having an XML element for each selected test, having the name of the test as attribute.)

The current version of CppUnit::XmlElement only has addAttribute functions:
http://cppunit.cvs.sourceforge.net/viewvc/cppunit/cppunit/include/cppunit/tools/XmlElement.h?revision=1.6

It seems quite natural to add the following functions:

int attributeCount() const;
std::string attributeNameAt( int index ) const;
std::string attributeValueAt( int index ) const;

So please consider the attached patch. The patch includes the implementation of those functions, as well as their tests.

Discussion

  • Niels Dekker

    Niels Dekker - 2008-10-22

    Patch, providing access to XmlElement attributes

     
  • Niels Dekker

    Niels Dekker - 2008-10-22
    • priority: 5 --> 6
    • assigned_to: nobody --> blep
     

Log in to post a comment.