Instance Method

object(byApplyingXSLTString:arguments:)

Applies the XSLT pattern rules and templates (specified as a string) to the receiver and returns a document object containing transformed XML or HTML markup.

Declaration

func object(byApplyingXSLTString xslt: String, arguments: [String : String]?) throws -> Any

Parameters

xslt

A string object containing the XSLT pattern rules and templates.

arguments

A dictionary containing NSString key-value pairs that are passed as runtime parameters to the XSLT processor. Pass in nil if you have no parameters to pass.

error

If an error occurs, indirectly returns an NSError object encapsulating error or warning messages generated by XSLT processing.

Return Value

Depending on intended output, the method returns an NSXMLDocument object or an NSData data containing transformed XML or HTML markup. If the message is supposed to create plain text or RTF, then an NSData object is returned, otherwise an XML document object. The method returns nil if XSLT processing did not succeed.

Discussion

See Also

Transforming a Document Using XSLT

func object(byApplyingXSLT: Data, arguments: [String : String]?) -> Any

Applies the XSLT pattern rules and templates (specified as a data object) to the receiver and returns a document object containing transformed XML or HTML markup.

func objectByApplyingXSLT(at: URL, arguments: [String : String]?) -> Any

Applies the XSLT pattern rules and templates located at a specified URL to the receiver and returns a document object containing transformed XML markup or an NSData object containing plain text, RTF text, and so on.