Plasma GitLab Archive
Projects Blog Knowledge

Class Pxp_document.attribute_impl

class ['a node #extension as 'a] attribute_impl : element:string -> name:string -> Pxp_types.att_value -> Pxp_dtd.dtd -> ['a] node
This class is an implementation of node which realizes attribute nodes. Create a new node by

new attribute_impl element_name attribute_name attribute_value dtd

Note that attribute nodes do intentionally not have extensions.

Attribute nodes are created on demand by the first invocation of attributes_as_nodes of the element node. Attribute nodes are created directly and not by copying exemplar nodes, so you never need to create them yourself.

Attribute nodes have the following properties:

  • The node type is T_attribute name.
  • The parent node is the element node.
  • The method "attributes" returns name, value , i.e. such nodes have a single attribute "name". To get the value, call n # attribute name.
  • The method "data" returns the string representation of the attribute value.
  • Attribute nodes are leaves of the tree.
Attribute nodes are designed to be members of XPath node sets, and are only useful if you need such sets.

This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml