Contents

element(withName:stringValue:)

Returns an Xmlelement object with a single text-node child containing the specified text.

Declaration

class func element(withName name: String, stringValue string: String) -> Any

Parameters

  • name:

    A string that is the name (tag identifier) of the element.

  • string:

    A string that is the content of the receiver’s text node.

Return Value

An NSXMLElement object with a single text-node child—an NSXMLNode object of kind XMLNode.Kind.text—containing the text specified in string. Returns nil if the object couldn’t be created.

Discussion

The equivalent XML markup is <``name``>``string``</``name``>.

See Also

Creating and Initializing Node Objects