Mac Developer Library

Developer

Foundation Framework Reference NSXMLDTDNode Class Reference

Options
Deployment Target:

On This Page
Language:

NSXMLDTDNode

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.

Inheritance


Conforms To


Import Statement


Swift

import Foundation

Objective-C

@import Foundation;

Availability


Available in OS X v10.4 and later.
  • init(XMLString:) - initWithXMLString: Designated Initializer

    Returns an NSXMLDTDNode object initialized with the DTD declaration in a given string.

    Declaration

    Swift

    init?(XMLString string: String)

    Objective-C

    - (instancetype)initWithXMLString:(NSString *)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.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.4 and later.

  • Returns the receiver’s DTD kind.

    Declaration

    Swift

    var DTDKind: NSXMLDTDNodeKind

    Objective-C

    @property NSXMLDTDNodeKind DTDKind

    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).

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.4 and later.

    See Also

    – setDTDKind:

  • Sets the receiver’s DTD kind.

    Declaration

    Objective-C

    - (void)setDTDKind:(NSXMLDTDNodeKind)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).

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Available in OS X v10.4 and later.

    See Also

    – DTDKind

  • Returns a Boolean value that indicates whether the receiver represents a declaration from an external DTD (the system ID is set).

    Declaration

    Objective-C

    - (BOOL)isExternal

    Return Value

    YEStrue if receiver represents a declaration from an external DTD (the system ID is set), otherwise NOfalse.

    Discussion

    This method is valid only for objects representing entities and notations.

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Available in OS X v10.4 and later.

  • Sets the notation name associated with the receiver.

    Declaration

    Swift

    var notationName: String?

    Objective-C

    @property(copy) NSString *notationName

    Parameters

    notationName

    The notation name associated with the receiver.

    Discussion

    This method is valid for entities only.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.4 and later.

  • Returns the name of the notation associated with the receiver.

    Declaration

    Swift

    var notationName: String?

    Objective-C

    @property(copy) NSString *notationName

    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.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.4 and later.

  • Sets the public identifier associated with the receiver.

    Declaration

    Swift

    var publicID: String?

    Objective-C

    @property(copy) NSString *publicID

    Parameters

    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.

    Discussion

    This method is valid for entities and notations only. When the public ID is set the system ID must also be set.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.4 and later.

  • Returns the public identifier associated with the receiver.

    Declaration

    Swift

    var publicID: String?

    Objective-C

    @property(copy) NSString *publicID

    Return Value

    The public identifier associated with the receiver.

    Discussion

    The public ID is applicable to entities and notations.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.4 and later.

  • Sets the system identifier associated with the receiver.

    Declaration

    Swift

    var systemID: String?

    Objective-C

    @property(copy) NSString *systemID

    Parameters

    systemID

    The system identifier associated with the receiver. This value must be a valid URI.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.4 and later.

    See Also

    – systemID

  • Returns the system identifier associated with the receiver.

    Declaration

    Swift

    var systemID: String?

    Objective-C

    @property(copy) NSString *systemID

    Return Value

    The system identifier associated with the receiver.

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.4 and later.

Data Types

  • 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.

    Declaration

    Swift

    enum NSXMLDTDNodeKind : UInt { case NSXMLEntityGeneralKind case NSXMLEntityParsedKind case NSXMLEntityUnparsedKind case NSXMLEntityParameterKind case NSXMLEntityPredefined case NSXMLAttributeCDATAKind case NSXMLAttributeIDKind case NSXMLAttributeIDRefKind case NSXMLAttributeIDRefsKind case NSXMLAttributeEntityKind case NSXMLAttributeEntitiesKind case NSXMLAttributeNMTokenKind case NSXMLAttributeNMTokensKind case NSXMLAttributeEnumerationKind case NSXMLAttributeNotationKind case NSXMLElementDeclarationUndefinedKind case NSXMLElementDeclarationEmptyKind case NSXMLElementDeclarationAnyKind case NSXMLElementDeclarationMixedKind case NSXMLElementDeclarationElementKind }

    Objective-C

    typedef NSUInteger NSXMLDTDNodeKind;

    Import Statement

    Objective-C

    @import Foundation;

    Swift

    import Foundation

    Availability

    Available in OS X v10.4 and later.

  • 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.

    Declaration

    Swift

    enum NSXMLDTDNodeKind : UInt { case NSXMLEntityGeneralKind case NSXMLEntityParsedKind case NSXMLEntityUnparsedKind case NSXMLEntityParameterKind case NSXMLEntityPredefined case NSXMLAttributeCDATAKind case NSXMLAttributeIDKind case NSXMLAttributeIDRefKind case NSXMLAttributeIDRefsKind case NSXMLAttributeEntityKind case NSXMLAttributeEntitiesKind case NSXMLAttributeNMTokenKind case NSXMLAttributeNMTokensKind case NSXMLAttributeEnumerationKind case NSXMLAttributeNotationKind case NSXMLElementDeclarationUndefinedKind case NSXMLElementDeclarationEmptyKind case NSXMLElementDeclarationAnyKind case NSXMLElementDeclarationMixedKind case NSXMLElementDeclarationElementKind }

    Objective-C

    enum { NSXMLEntityGeneralKind = 1, NSXMLEntityParsedKind, NSXMLEntityUnparsedKind, NSXMLEntityParameterKind, NSXMLEntityPredefined, NSXMLAttributeCDATAKind, NSXMLAttributeIDKind, NSXMLAttributeIDRefKind, NSXMLAttributeIDRefsKind, NSXMLAttributeEntityKind, NSXMLAttributeEntitiesKind, NSXMLAttributeNMTokenKind, NSXMLAttributeNMTokensKind, NSXMLAttributeEnumerationKind, NSXMLAttributeNotationKind, NSXMLElementDeclarationUndefinedKind, NSXMLElementDeclarationEmptyKind, NSXMLElementDeclarationAnyKind, NSXMLElementDeclarationMixedKind, NSXMLElementDeclarationElementKind };

    Constants

    • NSXMLEntityGeneralKind

      NSXMLEntityGeneralKind

      Identifies a general entity declaration.

      Available in OS X v10.4 and later.

    • NSXMLEntityParsedKind

      NSXMLEntityParsedKind

      Identifies a parsed entity declaration.

      Available in OS X v10.4 and later.

    • NSXMLEntityUnparsedKind

      NSXMLEntityUnparsedKind

      Identifies an unparsed entity declaration.

      Available in OS X v10.4 and later.

    • NSXMLEntityParameterKind

      NSXMLEntityParameterKind

      Identifies a parameter entity declaration.

      Available in OS X v10.4 and later.

    • NSXMLEntityPredefined

      NSXMLEntityPredefined

      Identifies a predefined entity declaration.

      Available in OS X v10.4 and later.

    • NSXMLAttributeCDATAKind

      NSXMLAttributeCDATAKind

      Identifies an attribute-list declaration with a CDATA (character data) value type.

      Available in OS X v10.4 and later.

    • NSXMLAttributeIDKind

      NSXMLAttributeIDKind

      Identifies an attribute-list declaration with an ID value type (per-document unique element name).

      Available in OS X v10.4 and later.

    • NSXMLAttributeIDRefKind

      NSXMLAttributeIDRefKind

      Identifies an attribute-list declaration with an IDREF value type (refers to element ID type).

      Available in OS X v10.4 and later.

    • NSXMLAttributeIDRefsKind

      NSXMLAttributeIDRefsKind

      Identifies an attribute-list declaration with an IDREFS value type (refers to multiple elements of ID type).

      Available in OS X v10.4 and later.

    • NSXMLAttributeEntityKind

      NSXMLAttributeEntityKind

      Identifies an attribute-list declaration with an ENTITY value type (refers to unparsed entity declared in document).

      Available in OS X v10.4 and later.

    • NSXMLAttributeEntitiesKind

      NSXMLAttributeEntitiesKind

      Identifies an attribute-list declaration with an ENTITIES value type (refers to multiple unparsed entities declared elsewhere in document).

      Available in OS X v10.4 and later.

    • NSXMLAttributeNMTokenKind

      NSXMLAttributeNMTokenKind

      Identifies an attribute-list declaration with a NMTOKEN value type (name token).

      Available in OS X v10.4 and later.

    • NSXMLAttributeNMTokensKind

      NSXMLAttributeNMTokensKind

      Identifies an attribute-list declaration with a NMTOKENS value type (multiple name tokens)

      Available in OS X v10.4 and later.

    • NSXMLAttributeEnumerationKind

      NSXMLAttributeEnumerationKind

      Identifies an attribute-list declaration with an enumeration value type (list of all possible values).

      Available in OS X v10.4 and later.

    • NSXMLAttributeNotationKind

      NSXMLAttributeNotationKind

      Identifies an attribute-list declaration with a NOTATION value type (name of declared notation).

      Available in OS X v10.4 and later.

    • NSXMLElementDeclarationUndefinedKind

      NSXMLElementDeclarationUndefinedKind

      Identifies an undefined element declaration.

      Available in OS X v10.4 and later.

    • NSXMLElementDeclarationEmptyKind

      NSXMLElementDeclarationEmptyKind

      Identifies a declaration (EMPTY) of an empty element.

      Available in OS X v10.4 and later.

    • NSXMLElementDeclarationAnyKind

      NSXMLElementDeclarationAnyKind

      Identifies an ANY element declaration.

      Available in OS X v10.4 and later.

    • NSXMLElementDeclarationMixedKind

      NSXMLElementDeclarationMixedKind

      Identifies a declaration of an element with mixed content ((#PCDATA | child)).

      Available in OS X v10.4 and later.

    • NSXMLElementDeclarationElementKind

      NSXMLElementDeclarationElementKind

      Identifies a declaration of an element with child elements.

      Available in OS X v10.4 and later.