63 lines
1.4 KiB
Swift
63 lines
1.4 KiB
Swift
//
|
|
// Param.swift
|
|
// HTMLStandard
|
|
//
|
|
// Generated on 09/23/2025.
|
|
// THIS FILE IS GENERATED. DO NOT EDIT.
|
|
//
|
|
import Foundation
|
|
|
|
/// <param> Parameter for object
|
|
public class Param : HTMLNode {
|
|
|
|
/// Name of parameter.
|
|
public var name:String? = nil
|
|
|
|
/// Value of parameter.
|
|
public var value:String? = nil
|
|
|
|
|
|
public init(_ attributes:[String:String], _ parser:XMLParser? = nil) throws {
|
|
var globalAttr = GlobalAttributesBuilder()
|
|
for (key, attValue) in attributes {
|
|
switch (key) {
|
|
case "name":
|
|
name = attValue
|
|
continue
|
|
case "value":
|
|
value = attValue
|
|
continue
|
|
|
|
default: break
|
|
}
|
|
if globalAttr.trySetGlobalAttribute(key, attValue) {
|
|
continue
|
|
}
|
|
continue
|
|
}
|
|
super.init(globalAttr)
|
|
}
|
|
|
|
|
|
public override func renderAttributes() -> String {
|
|
var result = super.renderAttributes()
|
|
if let name = name {
|
|
result += " name='\(name)'"
|
|
}
|
|
if let value = value {
|
|
result += " value='\(value)'"
|
|
}
|
|
|
|
|
|
return result
|
|
}
|
|
|
|
override var nodeName: String {
|
|
return "param"
|
|
}
|
|
|
|
override var isVoidElement: Bool {
|
|
return true
|
|
}
|
|
}
|