Initial Commit
This commit is contained in:
53
Sources/HRW/GenHTML/Elements/Col.swift
Normal file
53
Sources/HRW/GenHTML/Elements/Col.swift
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// Col.swift
|
||||
// HTMLStandard
|
||||
//
|
||||
// Generated on 09/23/2025.
|
||||
// THIS FILE IS GENERATED. DO NOT EDIT.
|
||||
//
|
||||
import Foundation
|
||||
|
||||
/// <col> Table column
|
||||
public class Col : HTMLNode {
|
||||
|
||||
/// Number of columns spanned by the element. Valid non-negative integer greater than zero.
|
||||
public var span:UInt? = nil
|
||||
|
||||
|
||||
public init(_ attributes:[String:String], _ parser:XMLParser? = nil) throws {
|
||||
var globalAttr = GlobalAttributesBuilder()
|
||||
for (key, attValue) in attributes {
|
||||
switch (key) {
|
||||
case "span":
|
||||
span = UInt(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 span = span {
|
||||
result += " span='\(span)'"
|
||||
}
|
||||
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
override var nodeName: String {
|
||||
return "col"
|
||||
}
|
||||
|
||||
override var isVoidElement: Bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user