00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Attributes.h 00006 * 00007 * Attributes.h,v 1.9 2005/04/20 16:22:53 ossama Exp 00008 * 00009 * @author Nanbor Wang <nanbor@cs.wustl.edu> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef _ACEXML_ATTRIBUTES_H_ 00014 #define _ACEXML_ATTRIBUTES_H_ 00015 #include /**/ "ace/pre.h" 00016 00017 #include "ACEXML/common/ACEXML_Export.h" 00018 00019 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00020 #pragma once 00021 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00022 00023 #include "ACEXML/common/XML_Types.h" 00024 00025 /** 00026 * @class ACEXML_Attributes Attributes.h "ACEXML/common/Attributes.h" 00027 * 00028 * @brief ACEXML_Attributes defines a collection of attributes of an XML element. 00029 * 00030 * This is an abstract class (interface in Java) that defines 00031 * the API for accessing attributes of an XML entity. 00032 * 00033 * This interface allows access to a list of attributes in three different ways: 00034 * 00035 * - by attribute index; 00036 * - by Namespace-qualified name; or 00037 * - by qualified (prefixed) name. 00038 * 00039 * The list will not contain attributes that were declared #IMPLIED 00040 * but not specified in the start tag. It will also not contain 00041 * attributes used as Namespace declarations (xmlns*) unless the 00042 * http://xml.org/sax/features/namespace-prefixes feature is set to 00043 * true (it is false by default). 00044 * 00045 * If the namespace-prefixes feature (see above) is false, access by 00046 * qualified name may not be available; if the 00047 * http://xml.org/sax/features/namespaces feature is false, access by 00048 * Namespace-qualified names may not be available. 00049 * 00050 * This interface replaces the now-deprecated SAX1 AttributeList 00051 * interface, which does not contain Namespace support. In addition to 00052 * Namespace support, it adds the getIndex methods (below). 00053 * 00054 * The order of attributes in the list is unspecified, and will vary 00055 * from implementation to implementation. 00056 */ 00057 class ACEXML_Export ACEXML_Attributes 00058 { 00059 public: 00060 00061 /// Destructor. 00062 virtual ~ACEXML_Attributes (void); 00063 00064 /** 00065 * Look up the index of an attribute by XML 1.0 qualified name. 00066 */ 00067 virtual int getIndex (const ACEXML_Char *qName) = 0; 00068 00069 /** 00070 * Look up the index of an attribute by Namespace name. 00071 */ 00072 virtual int getIndex (const ACEXML_Char *uri, 00073 const ACEXML_Char *localPart) = 0; 00074 00075 /** 00076 * Return the number of attributes in the list. 00077 */ 00078 virtual size_t getLength (void) = 0; 00079 00080 /** 00081 * Look up an attribute's local name by index. 00082 */ 00083 virtual const ACEXML_Char *getLocalName (size_t index) = 0; 00084 00085 /** 00086 * Look up an attribute's XML 1.0 qualified name by index. 00087 */ 00088 virtual const ACEXML_Char *getQName (size_t index) = 0; 00089 00090 /** 00091 * Look up an attribute's type by index. 00092 */ 00093 virtual const ACEXML_Char *getType (size_t index) = 0; 00094 00095 /** 00096 * Look up an attribute's type by XML 1.0 qualified name. 00097 */ 00098 virtual const ACEXML_Char *getType (const ACEXML_Char *qName) = 0; 00099 00100 /** 00101 * Look up an attribute's type by Namespace name. 00102 */ 00103 virtual const ACEXML_Char *getType (const ACEXML_Char *uri, 00104 const ACEXML_Char *localPart) = 0; 00105 00106 /** 00107 * Look up an attribute's Namespace URI by index. 00108 */ 00109 virtual const ACEXML_Char *getURI (size_t index) = 0; 00110 00111 /** 00112 * Look up an attribute's value by index. 00113 */ 00114 virtual const ACEXML_Char *getValue (size_t index) = 0; 00115 00116 /** 00117 * Look up an attribute's value by XML 1.0 qualified name. 00118 */ 00119 virtual const ACEXML_Char *getValue (const ACEXML_Char *qName) = 0; 00120 00121 /** 00122 * Look up an attribute's value by Namespace name. 00123 */ 00124 virtual const ACEXML_Char *getValue (const ACEXML_Char *uri, 00125 const ACEXML_Char *localPart) = 0; 00126 }; 00127 00128 #include /**/ "ace/post.h" 00129 00130 #endif /* _ACEXML_ ATTRIBUTES_H_ */