<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>Xerces-C++: AttributeList Class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.6 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li class="current"><a href="classes.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="classes.html"><span>Alphabetical List</span></a></li> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div> <div class="contents"> <h1>AttributeList Class Reference</h1><!-- doxytag: class="AttributeList" -->Interface for an element's attribute specifications. <a href="#_details">More...</a> <p> <p> <a href="classAttributeList-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td colspan="2"><div class="groupHeader">Constructors and Destructor</div></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttributeList.html#192435ac438fe36a41a978bced27a7dc">AttributeList</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#192435ac438fe36a41a978bced27a7dc"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttributeList.html#011a36f9db543d4e248a883a09e38246">~AttributeList</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#011a36f9db543d4e248a883a09e38246"></a><br></td></tr> <tr><td colspan="2"><div class="groupHeader">The virtual attribute list interface</div></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#c0f7e36996cd03eb43bcee10321f77cd">XMLSize_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttributeList.html#643f1b6465cb6f1f7cff89263efd833c">getLength</a> () const =0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the number of attributes in this list. <a href="#643f1b6465cb6f1f7cff89263efd833c"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttributeList.html#3d8a300ce791232a745b2af28856a356">getName</a> (const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#c0f7e36996cd03eb43bcee10321f77cd">XMLSize_t</a> index) const =0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the name of an attribute in this list (by position). <a href="#3d8a300ce791232a745b2af28856a356"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttributeList.html#0ddc41e174285f15a76caf1fdc2486fe">getType</a> (const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#c0f7e36996cd03eb43bcee10321f77cd">XMLSize_t</a> index) const =0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the type of an attribute in the list (by position). <a href="#0ddc41e174285f15a76caf1fdc2486fe"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttributeList.html#b4bf15238437e13da79bef4e6e13b6ef">getValue</a> (const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#c0f7e36996cd03eb43bcee10321f77cd">XMLSize_t</a> index) const =0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value of an attribute in the list (by position). <a href="#b4bf15238437e13da79bef4e6e13b6ef"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttributeList.html#9f6f66d9709e8937fc39c53a6e9e8306">getType</a> (const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> *const name) const =0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the type of an attribute in the list (by name). <a href="#9f6f66d9709e8937fc39c53a6e9e8306"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttributeList.html#feb329f05e0c21538314ee0ca36617a1">getValue</a> (const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> *const name) const =0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value of an attribute in the list (by name). <a href="#feb329f05e0c21538314ee0ca36617a1"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classAttributeList.html#156441032c80aa4214619c205bd1cd34">getValue</a> (const char *const name) const =0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value of an attribute in the list (by name). <a href="#156441032c80aa4214619c205bd1cd34"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Interface for an element's attribute specifications. <p> The SAX parser implements this interface and passes an instance to the SAX application as the second argument of each startElement event.<p> The instance provided will return valid results only during the scope of the startElement invocation (to save it for future use, the application must make a copy: the AttributeListImpl helper class provides a convenient constructor for doing so).<p> An <a class="el" href="classAttributeList.html" title="Interface for an element's attribute specifications.">AttributeList</a> includes only attributes that have been specified or defaulted: #IMPLIED attributes will not be included.<p> There are two ways for the SAX application to obtain information from the <a class="el" href="classAttributeList.html" title="Interface for an element's attribute specifications.">AttributeList</a>. First, it can iterate through the entire list:<p> <code> public void startElement (String name, <a class="el" href="classAttributeList.html" title="Interface for an element's attribute specifications.">AttributeList</a> atts) {<br> for (XMLSize_t i = 0; i < atts.getLength(); i++) {<br> String name = atts.getName(i);<br> String type = atts.getType(i);<br> String value = atts.getValue(i);<br> [...]<br> }<br> } </code><p> (Note that the result of <a class="el" href="classAttributeList.html#643f1b6465cb6f1f7cff89263efd833c" title="Return the number of attributes in this list.">getLength()</a> will be zero if there are no attributes.)<p> As an alternative, the application can request the value or type of specific attributes:<p> <code> public void startElement (String name, <a class="el" href="classAttributeList.html" title="Interface for an element's attribute specifications.">AttributeList</a> atts) {<br> String identifier = atts.getValue("id");<br> String label = atts.getValue("label");<br> [...]<br> } </code><p> The AttributeListImpl helper class provides a convenience implementation for use by parser or application writers.<p> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classDocumentHandler.html#15fb4581aec4828d3ee85b658f7ceb69" title="Receive notification of the beginning of an element.">DocumentHandler::startElement</a> <p> AttributeListImpl::AttributeListImpl </dd></dl> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="192435ac438fe36a41a978bced27a7dc"></a><!-- doxytag: member="AttributeList::AttributeList" ref="192435ac438fe36a41a978bced27a7dc" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">AttributeList::AttributeList </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Default constructor. <p> </div> </div><p> <a class="anchor" name="011a36f9db543d4e248a883a09e38246"></a><!-- doxytag: member="AttributeList::~AttributeList" ref="011a36f9db543d4e248a883a09e38246" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual AttributeList::~AttributeList </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Destructor. <p> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="643f1b6465cb6f1f7cff89263efd833c"></a><!-- doxytag: member="AttributeList::getLength" ref="643f1b6465cb6f1f7cff89263efd833c" args="() const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#c0f7e36996cd03eb43bcee10321f77cd">XMLSize_t</a> AttributeList::getLength </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return the number of attributes in this list. <p> The SAX parser may provide attributes in any arbitrary order, regardless of the order in which they were declared or specified. The number of attributes may be zero.<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of attributes in the list. </dd></dl> </div> </div><p> <a class="anchor" name="3d8a300ce791232a745b2af28856a356"></a><!-- doxytag: member="AttributeList::getName" ref="3d8a300ce791232a745b2af28856a356" args="(const XMLSize_t index) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a>* AttributeList::getName </td> <td>(</td> <td class="paramtype">const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#c0f7e36996cd03eb43bcee10321f77cd">XMLSize_t</a> </td> <td class="paramname"> <em>index</em> </td> <td> ) </td> <td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return the name of an attribute in this list (by position). <p> The names must be unique: the SAX parser shall not include the same attribute twice. <a class="el" href="classAttributes.html" title="Interface for an element's attribute specifications.">Attributes</a> without values (those declared #IMPLIED without a value specified in the start tag) will be omitted from the list.<p> If the attribute name has a namespace prefix, the prefix will still be attached.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>index</em> </td><td>The index of the attribute in the list (starting at 0). </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>The name of the indexed attribute, or null if the index is out of range. </dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classAttributeList.html#643f1b6465cb6f1f7cff89263efd833c" title="Return the number of attributes in this list.">getLength</a> </dd></dl> </div> </div><p> <a class="anchor" name="0ddc41e174285f15a76caf1fdc2486fe"></a><!-- doxytag: member="AttributeList::getType" ref="0ddc41e174285f15a76caf1fdc2486fe" args="(const XMLSize_t index) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a>* AttributeList::getType </td> <td>(</td> <td class="paramtype">const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#c0f7e36996cd03eb43bcee10321f77cd">XMLSize_t</a> </td> <td class="paramname"> <em>index</em> </td> <td> ) </td> <td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return the type of an attribute in the list (by position). <p> The attribute type is one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION" (always in upper case).<p> If the parser has not read a declaration for the attribute, or if the parser does not report attribute types, then it must return the value "CDATA" as stated in the XML 1.0 Recommentation (clause 3.3.3, "Attribute-Value Normalization").<p> For an enumerated attribute that is not a notation, the parser will report the type as "NMTOKEN".<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>index</em> </td><td>The index of the attribute in the list (starting at 0). </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>The attribute type as a string, or null if the index is out of range. </dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classAttributeList.html#643f1b6465cb6f1f7cff89263efd833c" title="Return the number of attributes in this list.">getLength</a> <p> <a class="el" href="classAttributeList.html#0ddc41e174285f15a76caf1fdc2486fe" title="Return the type of an attribute in the list (by position).">getType</a> </dd></dl> </div> </div><p> <a class="anchor" name="b4bf15238437e13da79bef4e6e13b6ef"></a><!-- doxytag: member="AttributeList::getValue" ref="b4bf15238437e13da79bef4e6e13b6ef" args="(const XMLSize_t index) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a>* AttributeList::getValue </td> <td>(</td> <td class="paramtype">const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#c0f7e36996cd03eb43bcee10321f77cd">XMLSize_t</a> </td> <td class="paramname"> <em>index</em> </td> <td> ) </td> <td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return the value of an attribute in the list (by position). <p> If the attribute value is a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the tokens will be concatenated into a single string separated by whitespace.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>index</em> </td><td>The index of the attribute in the list (starting at 0). </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>The attribute value as a string, or null if the index is out of range. </dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classAttributeList.html#643f1b6465cb6f1f7cff89263efd833c" title="Return the number of attributes in this list.">getLength</a> <p> <a class="el" href="classAttributeList.html#b4bf15238437e13da79bef4e6e13b6ef" title="Return the value of an attribute in the list (by position).">getValue</a> </dd></dl> </div> </div><p> <a class="anchor" name="9f6f66d9709e8937fc39c53a6e9e8306"></a><!-- doxytag: member="AttributeList::getType" ref="9f6f66d9709e8937fc39c53a6e9e8306" args="(const XMLCh *const name) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a>* AttributeList::getType </td> <td>(</td> <td class="paramtype">const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> *const </td> <td class="paramname"> <em>name</em> </td> <td> ) </td> <td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return the type of an attribute in the list (by name). <p> The return value is the same as the return value for getType(XMLSize_t).<p> If the attribute name has a namespace prefix in the document, the application must include the prefix here.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The name of the attribute. </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>The attribute type as a string, or null if no such attribute exists. </dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classAttributeList.html#0ddc41e174285f15a76caf1fdc2486fe" title="Return the type of an attribute in the list (by position).">getType</a> </dd></dl> </div> </div><p> <a class="anchor" name="feb329f05e0c21538314ee0ca36617a1"></a><!-- doxytag: member="AttributeList::getValue" ref="feb329f05e0c21538314ee0ca36617a1" args="(const XMLCh *const name) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a>* AttributeList::getValue </td> <td>(</td> <td class="paramtype">const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a> *const </td> <td class="paramname"> <em>name</em> </td> <td> ) </td> <td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return the value of an attribute in the list (by name). <p> The return value is the same as the return value for getValue(XMLSize_t).<p> If the attribute name has a namespace prefix in the document, the application must include the prefix here.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The name of the attribute in the list. </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>The attribute value as a string, or null if no such attribute exists. </dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classAttributeList.html#b4bf15238437e13da79bef4e6e13b6ef" title="Return the value of an attribute in the list (by position).">getValue</a> </dd></dl> </div> </div><p> <a class="anchor" name="156441032c80aa4214619c205bd1cd34"></a><!-- doxytag: member="AttributeList::getValue" ref="156441032c80aa4214619c205bd1cd34" args="(const char *const name) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual const <a class="el" href="Xerces__autoconf__config_8msvc_8hpp.html#fae8f92d83170d97f757f704eca7f52a">XMLCh</a>* AttributeList::getValue </td> <td>(</td> <td class="paramtype">const char *const </td> <td class="paramname"> <em>name</em> </td> <td> ) </td> <td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Return the value of an attribute in the list (by name). <p> The return value is the same as the return value for getValue(XMLSize_t).<p> If the attribute name has a namespace prefix in the document, the application must include the prefix here.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>The name of the attribute in the list. </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>The attribute value as a string, or null if no such attribute exists. </dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classAttributeList.html#b4bf15238437e13da79bef4e6e13b6ef" title="Return the value of an attribute in the list (by position).">getValue</a> </dd></dl> </div> </div><p> <hr>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="AttributeList_8hpp-source.html">AttributeList.hpp</a></ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 29 15:30:48 2010 for Xerces-C++ by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> </body> </html>