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) -> AnyParameters
- 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
init(kind:)init(kind:options:)document()document(withRootElement:)element(withName:)element(withName:children:attributes:)element(withName:uri:)attribute(withName:stringValue:)attribute(withName:uri:stringValue:)text(withStringValue:)comment(withStringValue:)namespace(withName:stringValue:)dtdNode(withXMLString:)predefinedNamespace(forPrefix:)processingInstruction(withName:stringValue:)