Initial Commit
This commit is contained in:
62
Sources/HRW/GenHTML/Elements/Param.swift
Normal file
62
Sources/HRW/GenHTML/Elements/Param.swift
Normal file
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// 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
|
||||
}
|
||||
throw AppError("Unexpected attribute: \(key)")
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user