![]() | InDesign SDK 20.5 |
#include <ISAXAttributeList.h>

Public Types | |
| enum | { kDefaultIID = IID_ISAXATTRIBUTELIST } |
Public Member Functions | |
| virtual void | Adopt (BIB_NAMESPACE::CAXEAttributeList attributes, ISAXDOMSerializerServices *owner)=0 |
| virtual int32 | GetLength () const =0 |
| virtual void | AttributeHandled (uint32 index)=0 |
| virtual bool16 | GetURI (uint32 index, WideString &uri) const =0 |
| virtual bool16 | GetLocalName (uint32 index, WideString &localName) const =0 |
| virtual bool16 | GetQName (uint32 index, WideString &qName) const =0 |
| virtual bool16 | GetType (uint32 index, WideString &attributeType) const =0 |
| virtual bool16 | GetValue (uint32 index, WideString &attributeValue) const =0 |
| virtual bool16 | GetIndex (const WideString &uri, const WideString &localPart, uint32 &index) const =0 |
| virtual bool16 | GetIndex (const WideString &qName, uint32 &index) const =0 |
| virtual bool16 | GetType (const WideString &uri, const WideString &localPart, WideString &attributeType) const =0 |
| virtual bool16 | GetType (const WideString &qName, WideString &attributeType) const =0 |
| virtual bool16 | GetValue (const WideString &uri, const WideString &localPart, WideString &attributeValue) const =0 |
| virtual bool16 | GetValue (const WideString &qName, WideString &attributeValue) const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
An InDesign friendly Wrapper for CAXEAttributeList. An instance of this class will be passed to ISaxContentHandler::StartElement.
Deliver a list of an element's attributes
The DOM serializer implements this interface and passes an instance as an argument of the startElement event. This class mimics the CAXEAttributes class so to make the interfaces of HAXEContentHandlerBase and HAXEDOMSerializerHandlerBase classes as similar as possible.
The instance provided is guaranteed to return valid results only during the scope of the startElement invocation. It is a reference to a live AXE DOM which could change. To save the attribute values for future use, the application must make a copy.
An attribute only includes traits that have been specified or defaulted: #IMPLIED attributes will not be included.
There are two ways for the application to obtain information from the CAXEAttributesList class. First, it can iterate through the entire list:
startElement(CAXEString& uri, CAXEString& localname,
CAXEString& qname, CAXEAttributeList& attrs,
CAXENodeDOM& sourceNode ) {
for (unsigned int i = 0; i < atts.getLength(); i++) {
CAXEString qName, URI, local, type, value;
if (!atts.getQName(i, qName)) ...
if (!atts.getURI(i, URI)) ...
if (!atts.getLocalName(i, local)) ...
if (!atts.getType(i, type)) ...
if (!atts.getValue(i, value)) ...
[...]
}
}
(Note: The result of getLength() will be zero if there are no attributes.)
As an alternative, the application can request the value or type of specific attributes by qualified name or by fully expanded name with namespace:
startElement(CAXEString& uri, CAXEString& localname,
CAXEString& qname, CAXEAttributeList& attrs,
CAXENodeDOM& sourceNode )
CAXEString identifier;
if (!atts.getValue("id", identifier)) ...
CAXEString label;
if (!atts.getValue("label", label)) ...
[...]
}
Invalid Parameters
Unless otherwise indicated, it is an error to use an invalid container (IsValid() == false), or a NULL pointer, as a parameter to any function. In some instances, the requirement that a specific parameter must be valid is repeated in the commentary for the specific function. The lack of any indication in the commentary for the specific function should still be taken to mean that an invalid container or NULL pointer will result in a kAXEErrClientFault exception.
| pure virtual |
Adopt an instance of a CAXEAttributeList class provided by the serializer. This is not intended to by used by clients.
| pure virtual |
Mark an attribute as handled so that other attribute handlers will not have to try and deal with it.
| index | The index of the attribute in the list (starting at 0). |
| pure virtual |
| pure virtual |
Index by XML 1.0 qualified name
| qName | The qualified (prefixed) name. |
| index | Output of index if returned true. |
| pure virtual |
Number of attributes in this list
The attributes may be delivered in any arbitrary order, regardless of the order in which they were declared or specified. The number of attributes may be zero.
| pure virtual |
Local name of an attribute by position
The QNames must be unique: no attribute will be included in the list twice. Attributes without values (those declared #IMPLIED without a value specified in the start tag) will be omitted from the list.
| index | The index of the attribute in the list (starting at 0). |
| localName | The output parameter specified by the caller to contain the returned local name of the indexed attribute. |
| pure virtual |
QName of an attribute by position
The QNames must be unique: no attribute will be included in the list twice. Attributes without values (those declared #IMPLIED without a value specified in the start tag) will be omitted from the list.
| index | The index of the attribute in the list (starting at 0). |
| qName | The output parameter specified by the caller to contain the returned QName of the indexed attribute. |
| pure virtual |
Return the type of an attribute in the list (by position).
This method is included to provide consistency with the CAXEAttributes class. Every call to this method will return "CDATA" as the type if the index is in range.
| index | The index of the attribute in the list (starting at 0). |
| attributeType | The output parameter specified by the caller to contain the returned type string of the indexed attribute. |
| pure virtual |
Type by namespace name
See GetType for a description of the possible types.
| uri | The namespace URI, or the empty string if the name has no namespace URI. |
| localPart | The local name of the attribute. |
| attributeType | The output parameter specified by the caller to contain the returned type string of the named attribute. |
| pure virtual |
Type by qualified name
See GetType for a description of the possible types.
| qName | The XML 1.0 qualified name. |
| attributeType | The output parameter specified by the caller to contain the returned type string of the named attribute. |
| pure virtual |
Namespace URI of an attribute by position
The QNames must be unique: no attribute will be included in the list twice. Attributes without values (those declared #IMPLIED without a value specified in the start tag) will be omitted from the list.
| index | The index of the attribute in the list (starting at 0). |
| uri | The output parameter specified by the caller to contain the returned URI. |
| pure virtual |
Value of an attribute by position
| index | The index of the attribute in the list (starting at 0). |
| attributeValue | The output parameter specified by the caller to contain the returned value of the indexed attribute. |
| pure virtual |
Value by namespace name
| uri | The namespace URI, or the empty String if the name has no Namespace URI. |
| localPart | The local name of the attribute. |
| attributeValue | The output parameter specified by the caller to contain the returned value of the named attribute. |
| pure virtual |
Look up an attribute's value by XML 1.0 qualified name.
| qName | The XML 1.0 qualified name. |
| attributeValue | The output parameter specified by the caller to contain the returned value of the named attribute. |