| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in Mac OS X v10.4 and later. |
| Companion guide | |
| Declared in | NSXMLDTDNode.h |
Instances of the NSXMLDTDNode class represent element, attribute-list, entity, and notation declarations in a Document Type Definition. NSXMLDTDNode objects are the sole children of a NSXMLDTD object (possibly along with comment nodes and processing-instruction nodes). They themselves cannot have any children.
NSXMLDTDNode objects can be of four kinds—element, attribute-list, entity, or notation declaration—and can also be of a subkind, as specified by a NSXMLDTDNodeKind constant. For example, a DTD entity-declaration node could represent an unparsed entity declaration (NSXMLEntityUnparsedKind) rather than a parameter entity declaration (NSXMLEntityParameterKind). You can use a DTD node’s subkind to help determine how to handle the value of the node.
You can create an NSXMLDTDNode object with the initWithXMLString: method, the NSXMLNode class method DTDNodeWithXMLString:, or with the NSXMLNode initializer initWithKind:options: (in the latter method supplying the appropriate NSXMLNodeKind constant).
Setting the object value or string value of an NSXMLDTDNode objects affects different parts of different kinds of declaration. See the related programming topic for more information.
Returns the receiver’s DTD kind.
- (NSXMLDTDNodeKind)DTDKind
The receiver’s DTD kind. See “Constants” for a list of valid NSXMLDTDNodeKind constants.
The DTD kind is distinct from a NSXMLDTDNode object’s node kind (returned by the NSXMLNode kind method).
NSXMLDTDNode.hReturns an NSXMLDTDNode object initialized with the DTD declaration in a given string.
- (id)initWithXMLString:(NSString *)string
The DTD declaration.
An NSXMLDTDNode object initialized with the DTD declaration in string. Returns nil if initialization did not succeed, as might occur if the passed-in declaration is malformed.
The node kind (NSXMLNode) assigned to the returned object—element, attribute, entity, or notation declaration— is based on the full XML string that is parsed. To assign a subkind, use the setDTDKind: method.
You may also use the DTDNodeWithXMLString: or initWithKind: methods to create NSXMLDTDNode instances. However, you cannot use the latter method to create NSXMLDTDNode instances for attribute-list declarations.
NSXMLDTDNode.hReturns a Boolean value that indicates whether the receiver represents a declaration from an external DTD (the system ID is set).
- (BOOL)isExternal
YES if receiver represents a declaration from an external DTD (the system ID is set), otherwise NO.
This method is valid only for objects representing entities and notations.
NSXMLDTDNode.hReturns the name of the notation associated with the receiver.
- (NSString *)notationName
The name of the notation associated with the receiver.
Notations are applicable to unparsed external entities, processing instructions, and some attribute values.
NSXMLDTDNode.hReturns the public identifier associated with the receiver.
- (NSString *)publicID
The public identifier associated with the receiver.
The public ID is applicable to entities and notations.
NSXMLDTDNode.hSets the receiver’s DTD kind.
- (void)setDTDKind:(NSXMLDTDNodeKind)kind
The receiver’s DTD kind. See “Constants” for a list of valid NSXMLDTDNodeKind constants.
The DTD kind is a finer grain of an NSXMLDTDNode object’s node kind (returned by the NSXMLNode kind method).
NSXMLDTDNode.hSets the notation name associated with the receiver.
- (void)setNotationName:(NSString *)notationName
The notation name associated with the receiver.
This method is valid for entities only.
NSXMLDTDNode.hSets the public identifier associated with the receiver.
- (void)setPublicID:(NSString *)publicID
The public identifier associated with the receiver. This identifier should be in the default catalog in /etc/xml/catalog or in a path specified by the environment variable XML_CATALOG_FILES.
This method is valid for entities and notations only. When the public ID is set the system ID must also be set.
NSXMLDTDNode.hSets the system identifier associated with the receiver.
- (void)setSystemID:(NSString *)systemID
The system identifier associated with the receiver. This value must be a valid URI.
NSXMLDTDNode.hReturns the system identifier associated with the receiver.
- (NSString *)systemID
The system identifier associated with the receiver.
NSXMLDTDNode.hThe type defined for the constants that specify the kind and subkind of DTD declaration represented by an NSXMLDTDNode object. You set the DTD-node kind using the setDTDKind: method.
typedef NSUInteger NSXMLDTDNodeKind;
NSXMLDTDNode.hConstants that specify the kind and subkind of DTD declaration represented by an NSXMLDTDNode object. You set the DTD-node kind using the setDTDKind: method.
enum {
NSXMLEntityGeneralKind = 1,
NSXMLEntityParsedKind,
NSXMLEntityUnparsedKind,
NSXMLEntityParameterKind,
NSXMLEntityPredefined,
NSXMLAttributeCDATAKind,
NSXMLAttributeIDKind,
NSXMLAttributeIDRefKind,
NSXMLAttributeIDRefsKind,
NSXMLAttributeEntityKind,
NSXMLAttributeEntitiesKind,
NSXMLAttributeNMTokenKind,
NSXMLAttributeNMTokensKind,
NSXMLAttributeEnumerationKind,
NSXMLAttributeNotationKind,
NSXMLElementDeclarationUndefinedKind,
NSXMLElementDeclarationEmptyKind,
NSXMLElementDeclarationAnyKind,
NSXMLElementDeclarationMixedKind,
NSXMLElementDeclarationElementKind
};
NSXMLEntityGeneralKindIdentifies a general entity declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLEntityParsedKindIdentifies a parsed entity declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLEntityUnparsedKindIdentifies an unparsed entity declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLEntityParameterKindIdentifies a parameter entity declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLEntityPredefinedIdentifies a predefined entity declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLAttributeCDATAKindIdentifies an attribute-list declaration with a CDATA (character data) value type.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLAttributeIDKindIdentifies an attribute-list declaration with an ID value type (per-document unique element name).
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLAttributeIDRefKindIdentifies an attribute-list declaration with an IDREF value type (refers to element ID type).
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLAttributeIDRefsKindIdentifies an attribute-list declaration with an IDREFS value type (refers to multiple elements of ID type).
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLAttributeEntityKindIdentifies an attribute-list declaration with an ENTITY value type (refers to unparsed entity declared in document).
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLAttributeEntitiesKindIdentifies an attribute-list declaration with an ENTITIES value type (refers to multiple unparsed entities declared elsewhere in document).
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLAttributeNMTokenKindIdentifies an attribute-list declaration with a NMTOKEN value type (name token).
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLAttributeNMTokensKindIdentifies an attribute-list declaration with a NMTOKENS value type (multiple name tokens)
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLAttributeEnumerationKindIdentifies an attribute-list declaration with an enumeration value type (list of all possible values).
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLAttributeNotationKindIdentifies an attribute-list declaration with a NOTATION value type (name of declared notation).
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLElementDeclarationUndefinedKindIdentifies an undefined element declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLElementDeclarationEmptyKindIdentifies a declaration (EMPTY) of an empty element.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLElementDeclarationAnyKindIdentifies an ANY element declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLElementDeclarationMixedKindIdentifies a declaration of an element with mixed content ((#PCDATA | child)).
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLElementDeclarationElementKindIdentifies a declaration of an element with child elements.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h.
NSXMLDTDNode.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-27)