Links: Next Previous Up Top

# What do I do with an `SGMLS_Attribute`?

Note that objects of the `SGMLS_Attribute` class do not have events in their own right, and are available only through the `attributes` or `attribute(<IT>aname</IT>)` methods for `SGMLS_Element` objects. An object belonging to the `SGMLS_Attribute` class will recognise the methods listed in table 4.

### Table 4: The `SGMLS_Attribute` class

Method
  `name`
Return Type
  string
Description
  The name of the attribute (in upper-case).

Method
  `type`
Return Type
  string
Description
  The type of the attribute: `'IMPLIED'`, `'CDATA'`, `'NOTATION'`, `'ENTITY'`, or `'TOKEN'`.

Method
  `value`
Return Type
  string, `SGMLS_Entity`, or `SGMLS_Notation`.
Description
  The value of the attribute. If the type is `'CDATA'` or `'TOKEN'`, it will be a simple string; if it is `'NOTATION'` it will be an object belonging to the `SGMLS_Notation` class, and if it is `'Entity'` it will be an object belonging to the `SGMLS_Entity` class.

Method
  `is_implied`
Return Type
  boolean
Description
  Return true if the value of the attribute is implied, or false if it has an explicit value.

Method
  `set_type(<IT>type</IT>)`
Return Type
  [none]
Description
  Provide a new type for the current attribute -- no sanity checking will be performed, so be careful.

Method
  `set_value(<IT>value</IT>)`
Return Type
  [none]
Description
  Provide a new value for the current attribute -- no sanity checking will be performed, so be careful.

Note that the type `'TOKEN'` includes both individual tokens and lists of tokens (ie `'TOKENS'`, `'IDS'`, or `'IDREFS'` in the original SGML document), so you might need to use the perl function 'split' to break the value string into a list.

Links: Next Previous Up Top