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.h
Returns 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.h
Returns 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.h
Returns 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.h
Returns 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.h
Sets 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.h
Sets 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.h
Sets 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.h
Sets 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.h
Returns the system identifier associated with the receiver.
- (NSString *)systemID
The system identifier associated with the receiver.
NSXMLDTDNode.h
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;
NSXMLDTDNode.h
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 };
NSXMLEntityGeneralKind
Identifies a general entity declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h
.
NSXMLEntityParsedKind
Identifies a parsed entity declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h
.
NSXMLEntityUnparsedKind
Identifies an unparsed entity declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h
.
NSXMLEntityParameterKind
Identifies a parameter entity declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h
.
NSXMLEntityPredefined
Identifies a predefined entity declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h
.
NSXMLAttributeCDATAKind
Identifies an attribute-list declaration with a CDATA
(character data) value type.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h
.
NSXMLAttributeIDKind
Identifies 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
.
NSXMLAttributeIDRefKind
Identifies 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
.
NSXMLAttributeIDRefsKind
Identifies 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
.
NSXMLAttributeEntityKind
Identifies 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
.
NSXMLAttributeEntitiesKind
Identifies 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
.
NSXMLAttributeNMTokenKind
Identifies an attribute-list declaration with a NMTOKEN
value type (name token).
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h
.
NSXMLAttributeNMTokensKind
Identifies 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
.
NSXMLAttributeEnumerationKind
Identifies 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
.
NSXMLAttributeNotationKind
Identifies 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
.
NSXMLElementDeclarationUndefinedKind
Identifies an undefined element declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h
.
NSXMLElementDeclarationEmptyKind
Identifies a declaration (EMPTY
) of an empty element.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h
.
NSXMLElementDeclarationAnyKind
Identifies an ANY
element declaration.
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h
.
NSXMLElementDeclarationMixedKind
Identifies a declaration of an element with mixed content ((#PCDATA | child)
).
Available in Mac OS X v10.4 and later.
Declared in NSXMLDTDNode.h
.
NSXMLElementDeclarationElementKind
Identifies 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)