Name

GroveAttr — XML element attribute node.

Synopsis

class GroveAttr
  :  : public GroveNodeWithNamespaceSernaApi::GroveNodeWithNamespace
 {
public:
  
  enum Defaulted;

  // Attribute value type. 
  enum AttrType { INVALID, IMPLIED, CDATA, TOKENIZED };

  // ID class of the attribute. Note that IDREFS is not yet supported. 
  enum IdClass { NOT_ID, IS_ID, IS_IDREF, IS_IDREFS };
  // construct/copy/destruct
  GroveAttr(SernaApiBase *);
  GroveAttr(const SString &, const SString & = SString());
  ~GroveAttr();

  // public member functions

  GroveElement element() const;
  bool specified() const;
  SString value() const;
  void build() ;
  void setValue(const SString &) ;
  void setName(const SString &) ;
  bool tokenized() const;
  Defaulted defaulted() const;
  AttrType type() const;
  void setDefaulted(const Defaulted) ;
  void setType(const AttrType) ;
  IdClass idClass() const;
  void setIdClass(IdClass) ;
};

Description

GroveAttr construct/copy/destruct

  1. GroveAttr(SernaApiBase * );


  2. GroveAttr(const SString & attributeName, const SString & value = SString());


  3. ~GroveAttr();


GroveAttr public member functions

  1. GroveElement element() const;

    Returns parent element.


  2. bool specified() const;

    Check whether value of this attribute was explicitly specified (not defaulted via dtd/prolog/schema)


  3. SString value() const;

    A string value of an attribute. For tokenized values, this is a concatenation of tokens with single blank as a separator.


  4. void build() ;

    Build string attribute value (which can be accessed via value() member function) from attribute node children.


  5. void setValue(const SString & val) ;

    Sets CDATA-only attribute value.


  6. void setName(const SString & ) ;

    Sets the new name of an attribute. This function also performs name parsing and namespace processing, if necessary.


  7. bool tokenized() const;

    True if attribute is tokenized.


  8. Defaulted defaulted() const;

    Returns defaulting type of attribute (see enum Defaulted)


  9. AttrType type() const;

    Attribute value type.


  10. void setDefaulted(const Defaulted d) ;

    Set attribute specification (defaulting) type.


  11. void setType(const AttrType t) ;

    Set attribute value type.


  12. IdClass idClass() const;

    Returns ID class.


  13. void setIdClass(IdClass idc) ;

    Set new ID class. Use with caution.