NSXMLDTDNode Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in OS X v10.4 and later. |
| Companion guide | |
| Declared in | NSXMLDTDNode.h |
Overview
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.
Instance Methods
DTDKind
Returns the receiver’s DTD kind.
Return Value
The receiver’s DTD kind. See “Constants” for a list of valid NSXMLDTDNodeKind constants.
Discussion
The DTD kind is distinct from a NSXMLDTDNode object’s node kind (returned by the NSXMLNode kind method).
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSXMLDTDNode.hinitWithXMLString:
Returns an NSXMLDTDNode object initialized with the DTD declaration in a given string.
Parameters
- string
The DTD declaration.
Return Value
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.
Discussion
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.
Availability
- Available in OS X v10.4 and later.
Declared In
NSXMLDTDNode.hisExternal
Returns a Boolean value that indicates whether the receiver represents a declaration from an external DTD (the system ID is set).
Return Value
YES if receiver represents a declaration from an external DTD (the system ID is set), otherwise NO.
Discussion
This method is valid only for objects representing entities and notations.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSXMLDTDNode.hnotationName
Returns the name of the notation associated with the receiver.
Return Value
The name of the notation associated with the receiver.
Discussion
Notations are applicable to unparsed external entities, processing instructions, and some attribute values.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSXMLDTDNode.hpublicID
Returns the public identifier associated with the receiver.
Return Value
The public identifier associated with the receiver.
Discussion
The public ID is applicable to entities and notations.
Availability
- Available in OS X v10.4 and later.
Declared In
NSXMLDTDNode.hsetDTDKind:
Sets the receiver’s DTD kind.
Parameters
- kind
The receiver’s DTD kind. See “Constants” for a list of valid NSXMLDTDNodeKind constants.
Discussion
The DTD kind is a finer grain of an NSXMLDTDNode object’s node kind (returned by the NSXMLNode kind method).
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSXMLDTDNode.hsetNotationName:
Sets the notation name associated with the receiver.
Parameters
- notationName
The notation name associated with the receiver.
Discussion
This method is valid for entities only.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSXMLDTDNode.hsetPublicID:
Sets the public identifier associated with the receiver.
Parameters
- publicID
The public identifier associated with the receiver. This identifier should be in the default catalog in
/etc/xml/catalogor in a path specified by the environment variableXML_CATALOG_FILES.
Discussion
This method is valid for entities and notations only. When the public ID is set the system ID must also be set.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSXMLDTDNode.hsetSystemID:
Sets the system identifier associated with the receiver.
Parameters
- systemID
The system identifier associated with the receiver. This value must be a valid URI.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSXMLDTDNode.hsystemID
Returns the system identifier associated with the receiver.
Return Value
The system identifier associated with the receiver.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSXMLDTDNode.hConstants
NSXMLDTDNodeKind
The 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;
Availability
- Available in OS X v10.4 and later.
Declared In
NSXMLDTDNode.hDTD Node Kind Constants
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.
enum {
NSXMLEntityGeneralKind = 1,
NSXMLEntityParsedKind,
NSXMLEntityUnparsedKind,
NSXMLEntityParameterKind,
NSXMLEntityPredefined,
NSXMLAttributeCDATAKind,
NSXMLAttributeIDKind,
NSXMLAttributeIDRefKind,
NSXMLAttributeIDRefsKind,
NSXMLAttributeEntityKind,
NSXMLAttributeEntitiesKind,
NSXMLAttributeNMTokenKind,
NSXMLAttributeNMTokensKind,
NSXMLAttributeEnumerationKind,
NSXMLAttributeNotationKind,
NSXMLElementDeclarationUndefinedKind,
NSXMLElementDeclarationEmptyKind,
NSXMLElementDeclarationAnyKind,
NSXMLElementDeclarationMixedKind,
NSXMLElementDeclarationElementKind
};
Constants
NSXMLEntityGeneralKindIdentifies a general entity declaration.
Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLEntityParsedKindIdentifies a parsed entity declaration.
Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLEntityUnparsedKindIdentifies an unparsed entity declaration.
Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLEntityParameterKindIdentifies a parameter entity declaration.
Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLEntityPredefinedIdentifies a predefined entity declaration.
Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLAttributeCDATAKindIdentifies an attribute-list declaration with a
CDATA(character data) value type.Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLAttributeIDKindIdentifies an attribute-list declaration with an
IDvalue type (per-document unique element name).Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLAttributeIDRefKindIdentifies an attribute-list declaration with an
IDREFvalue type (refers to elementIDtype).Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLAttributeIDRefsKindIdentifies an attribute-list declaration with an
IDREFSvalue type (refers to multiple elements ofIDtype).Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLAttributeEntityKindIdentifies an attribute-list declaration with an
ENTITYvalue type (refers to unparsed entity declared in document).Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLAttributeEntitiesKindIdentifies an attribute-list declaration with an
ENTITIESvalue type (refers to multiple unparsed entities declared elsewhere in document).Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLAttributeNMTokenKindIdentifies an attribute-list declaration with a
NMTOKENvalue type (name token).Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLAttributeNMTokensKindIdentifies an attribute-list declaration with a
NMTOKENSvalue type (multiple name tokens)Available in 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 OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLAttributeNotationKindIdentifies an attribute-list declaration with a
NOTATIONvalue type (name of declared notation).Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLElementDeclarationUndefinedKindIdentifies an undefined element declaration.
Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLElementDeclarationEmptyKindIdentifies a declaration (
EMPTY) of an empty element.Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLElementDeclarationAnyKindIdentifies an
ANYelement declaration.Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLElementDeclarationMixedKindIdentifies a declaration of an element with mixed content (
(#PCDATA | child)).Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.NSXMLElementDeclarationElementKindIdentifies a declaration of an element with child elements.
Available in OS X v10.4 and later.
Declared in
NSXMLDTDNode.h.
Declared In
NSXMLDTDNode.h© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-27)