<HTML> <HEAD> <TITLE>What do I do with an SGMLS_Attribute?</TITLE> </HEAD> <BODY> <P><B>Links</B>: <A HREF=sgmlsentity.html>Next</A> <A HREF=sgmlselement.html>Previous</A> <A HREF=sgmlspm.html>Up</A> <A HREF=sgmlspm.html>Top</A></P> <H1>What do I do with an <TT>SGMLS_Attribute</TT>?</H1> <P>Note that objects of the <TT>SGMLS_Attribute</TT> class do not have events in their own right, and are available only through the <TT>attributes</TT> or <TT>attribute(<IT>aname</IT>)</TT> methods for <A HREF=sgmlselement.html><TT>SGMLS_Element</TT></A> objects. An object belonging to the <TT>SGMLS_Attribute</TT> class will recognise the methods listed in table 4.</P> <H3>Table 4: The <TT>SGMLS_Attribute</TT> class</H3> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>name</TT></DD> <DT><B>Return Type</B></DT> <DD>string</DD> <DT><B>Description</B></DT> <DD>The name of the attribute (in upper-case).</DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>type</TT></DD> <DT><B>Return Type</B></DT> <DD>string</DD> <DT><B>Description</B></DT> <DD>The type of the attribute: <TT>'IMPLIED'</TT>, <TT>'CDATA'</TT>, <TT>'NOTATION'</TT>, <TT>'ENTITY'</TT>, or <TT>'TOKEN'</TT>.</DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>value</TT></DD> <DT><B>Return Type</B></DT> <DD>string, <TT>SGMLS_Entity</TT>, or <TT>SGMLS_Notation</TT>.</DD> <DT><B>Description</B></DT> <DD>The value of the attribute. If the type is <TT>'CDATA'</TT> or <TT>'TOKEN'</TT>, it will be a simple string; if it is <TT>'NOTATION'</TT> it will be an object belonging to the <TT>SGMLS_Notation</TT> class, and if it is <TT>'Entity'</TT> it will be an object belonging to the <TT>SGMLS_Entity</TT> class.</DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>is_implied</TT></DD> <DT><B>Return Type</B></DT> <DD>boolean</DD> <DT><B>Description</B></DT> <DD>Return true if the value of the attribute is implied, or false if it has an explicit value.</DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>set_type(<IT>type</IT>)</TT></DD> <DT><B>Return Type</B></DT> <DD>[none]</DD> <DT><B>Description</B></DT> <DD>Provide a new type for the current attribute -- no sanity checking will be performed, so be careful.</DD> </DL> <HR> <DL> <DT><B>Method</B></DT> <DD><TT>set_value(<IT>value</IT>)</TT></DD> <DT><B>Return Type</B></DT> <DD>[none]</DD> <DT><B>Description</B></DT> <DD>Provide a new value for the current attribute -- no sanity checking will be performed, so be careful.</DD> </DL> <HR> <P>Note that the type <TT>'TOKEN'</TT> includes both individual tokens and lists of tokens (ie <TT>'TOKENS'</TT>, <TT>'IDS'</TT>, or <TT>'IDREFS'</TT> in the original <A HREF="http://www.sil.org/sgml/sgml.html"><B>SGML</B></A> document), so you might need to use the perl function 'split' to break the value string into a list.</P> <P><B>Links</B>: <A HREF=sgmlsentity.html>Next</A> <A HREF=sgmlselement.html>Previous</A> <A HREF=sgmlspm.html>Up</A> <A HREF=sgmlspm.html>Top</A></P> <ADDRESS>David Megginson <A HREF="mailto:dmeggins@aix1.uottawa.ca"><dmeggins@aix1.uottawa.ca></A></ADDRESS> </BODY> </HTML>