Contents

dtdNode(withXMLString:)

Returns a Xmldtdnode object representing the DTD declaration for an element, attribute, entity, or notation based on a given string.

Declaration

class func dtdNode(withXMLString string: String) -> Any?

Parameters

  • string:

    A string that is a DTD declaration. The receiver parses this string to determine the kind of DTD node to create.

Return Value

An NSXMLDTDNode object representing the DTD declaration or nil if the object couldn’t be created.

Discussion

For example, if string is the following:

<!ENTITY name (#PCDATA)>

NSXMLNode is able to assign the created node object a kind of XMLNode.Kind.entityDeclaration by parsing “ENTITY”.

Note that if an attribute-list declaration (<!ATTLIST...> )has multiple attributes NSXMLNode only creates an NSXMLDTDNode object for the last attribute in the declaration.

See Also

Creating and Initializing Node Objects