[libxml++] Re: Adding some w3c DOM methods



I have an example of the changes I am thinking about below. They amount
to adding a few inline methods to some of the classes. Here are some
changes to element.h:

<kurt dirac>$ cvs diff element.h
Index: element.h
===================================================================
RCS file: /cvsroot/libxmlplusplus/libxml++/libxml++/nodes/element.h,v
retrieving revision 1.16
diff -r1.16 element.h
103a104,127
>   std::string getAttributeNS(const std::string& namespaceURI,
>                              const std::string& localName) const {
>     Attribute* a(get_attribute(localName, namespaceURI));
>     return a ? a->get_value() : "";
>   }
>   std::string getAttribute(const std::string& name) const {
>     return getAttributeNS(std::string(), name);
>   }
>   void setAttributeNS(const std::string& namespaceURI,
>                       const std::string& localName,
>                       const std::string& value) {
>     set_attribute(localName, value, namespaceURI);
>   }
>   void setAttribute(const std::string& name, const std::string& value)
{
>     setAttributeNS(std::string(), name, value);
>   }
>   bool hasAttributeNS(const std::string& namespaceURI,
>                       const std::string& localName) const {
>     return get_attribute(localName, namespaceURI) != 0;
>   }
>   bool hasAttribute(const std::string& name) {
>     return hasAttributeNS(std::string(), name);
>   }
>



On Thu, 2004-02-26 at 22:49, Kurt M. Brown wrote:
> I often use w3c DOM interface implementations in several languages
> (e.g., C++, javascript, perl, and php) all in the same day. So
> commonality in method names is wonderful.
> 
> The C++ implementation I use is home-grown and I want to start using
> libxml++.
> 
> Well, I am wondering what you think of adding a few simple inline
> methods to match *some* of the w3c DOM interface?
> 
> I would be happy to supply patch files or help in any way.
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]