57 lines
1.4 KiB
Swift
57 lines
1.4 KiB
Swift
//
|
|
// Html.swift
|
|
// HTMLStandard
|
|
//
|
|
// Generated on 09/23/2025.
|
|
// THIS FILE IS GENERATED. DO NOT EDIT.
|
|
//
|
|
import Foundation
|
|
|
|
/// <html> Root element
|
|
public class Html : HTMLNode {
|
|
|
|
/// Application cache manifest. Valid non-empty URL potentially surrounded by spaces.
|
|
public var manifest:URL? = nil
|
|
|
|
|
|
public init(_ attributes:[String:String], _ parser:XMLParser? = nil) throws {
|
|
var globalAttr = GlobalAttributesBuilder()
|
|
for (key, attValue) in attributes {
|
|
switch (key) {
|
|
case "manifest":
|
|
manifest = try URL(expect: attValue)
|
|
continue
|
|
|
|
default: break
|
|
}
|
|
if globalAttr.trySetGlobalAttribute(key, attValue) {
|
|
continue
|
|
}
|
|
throw AppError("Unexpected attribute: \(key)")
|
|
}
|
|
var allItems:[HTMLNode] = []
|
|
while let obj = try parser?.readObject(endTag: "html", xmlToHtmlMapper) {
|
|
allItems.append(obj)
|
|
}
|
|
super.init(globalAttr, allItems)
|
|
}
|
|
|
|
|
|
public override func renderAttributes() -> String {
|
|
var result = super.renderAttributes()
|
|
if let manifest = manifest {
|
|
result += " manifest='\(manifest.absoluteString)'"
|
|
}
|
|
|
|
|
|
return result
|
|
}
|
|
|
|
override var nodeName: String {
|
|
return "html"
|
|
}
|
|
|
|
override var isVoidElement: Bool {
|
|
return false
|
|
}
|
|
} |