Open Instance Methodscinfu.swiftsoup 2.8.7SwiftSoup
setValue(value:)
Set the attribute value.
@discardableResult func setValue(value: [UInt8]) -> [UInt8]
<param>
Set the attribute value.
@discardableResult func setValue(value: [UInt8]) -> [UInt8]
<param>
import SwiftSoup
class Attribute
@frozen struct UInt8
An 8-bit unsigned integer value type.
convenience init(key: String, value: String) throws
init(key: [UInt8], value: [UInt8]) throws
static func createFromEncoded(unencodedKey: [UInt8], encodedValue: [UInt8]) throws -> Attribute
Create a new Attribute from an unencoded key and a HTML attribute encoded value.
static func == (lhs: Attribute, rhs: Attribute) -> Bool
func clone() -> Attribute
func getKey() -> String
Get the attribute key.
func getKeyUTF8() -> [UInt8]
func getValue() -> String
Get the attribute value.
func getValueUTF8() -> [UInt8]
func hashCode() -> Int
func html() -> String
Get the HTML representation of this attribute; e.g. {@code href=“index.html”}.
func html(accum: StringBuilder, out: OutputSettings)
func isBooleanAttribute() -> Bool
func isDataAttribute() -> Bool
func setKey(key: String) throws
func setKey(key: [UInt8]) throws
Set the attribute key; case is preserved.
final func shouldCollapseAttribute(out: OutputSettings) -> Bool
Collapsible if it’s a boolean attribute and value is empty or same as name
func toString() -> String
Get the string representation of this attribute, implemented as {@link #html()}.