GetProperty Method

Gets the value of a specific RSS feed item element or attribute.

Syntax

public func getProperty(propertyName: String) throws -> String

Remarks

This method is intended for extending functionality of the RSS class. It will get the value for a specific item element or attribute of this RSS feed. Property is the XPath of the element or attribute according to the following convention: root/element@attribute. The @attribute part is optional, and the root field can be any of the four following values:

channelThis treats the channel as the root level, and element is any property of the channel. If the empty string ("") is supplied for the root field, the class will assume channel as the root.
imageThis treats the channel's image as the root level, and element is any property of an image.
textInputThis treats the channel's textInput as the root level, and element is any property of an textInput.
item[x]This treats the channel's xth item as the root level where the indexer x starts at 1. The field element is any property of an item.

The element field can be any property of the root field, and attribute can be any property of that field. If an attribute is not supplied, this method will return the text portion of element. For example:


  RSSControl.GetProperty("item[5]/guid@isPermaLink")
  RSSControl.GetProperty("item[5]/link")
  RSSControl.GetProperty("/channel/title")

Note: in order to add non-standard fields (i.e. fields that are not defined in the RSS specification), element must be prefixed with a namespace that defines that field. The same applies for the attribute field. Use the Namespaces properties to define and list namespaces.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 macOS Edition - Version 20.0 [Build 8307]