PureXML/Sources/Model/Attribute.swift
Mihaela Mihaljevic 708390242c chore: scaffold PureXML pure-Swift XML package
Root Swift package mirroring PureYAML's structure, rules, and verification
gates. Includes the XML node model (Node, Element, Attribute, QualifiedName),
a working emitter (Serializer) with escaping and pretty/compact options, and
structural validation. The parser surface is stable; parse() raises
notImplemented until the scanner lands, pinned by a test.

- dependency-free, namespaced under PureXML
- portability and style gates carried over (style, namespacing, forbidden
  patterns, swiftformat, swiftlint, linux, wasm, windows CI)
- 11 tests passing
2026-06-07 23:20:20 +02:00

18 lines
494 B
Swift

public extension PureXML.Model {
/// A single name/value attribute on an XML element.
struct Attribute: Equatable, Hashable, Sendable {
public var name: QualifiedName
public var value: String
public init(name: QualifiedName, value: String) {
self.name = name
self.value = value
}
public init(_ name: String, _ value: String) {
self.name = QualifiedName(name)
self.value = value
}
}
}