Skip to content

Commit

Permalink
WIP: add parent to XMLElement
Browse files Browse the repository at this point in the history
  • Loading branch information
drmohundro committed Oct 30, 2023
1 parent 7226ebc commit 2eedebf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/XMLElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import Foundation
public class XMLElement: XMLContent {
/// The name of the element
public let name: String

Check failure on line 32 in Source/XMLElement.swift

View workflow job for this annotation

GitHub Actions / Docker Lint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
public private(set) var parent: XMLElement?

/// Whether the element is case insensitive or not
public var caseInsensitive: Bool {
Expand Down Expand Up @@ -116,6 +118,7 @@ public class XMLElement: XMLContent {

func addElement(_ name: String, withAttributes attributes: [String: String], caseInsensitive: Bool) -> XMLElement {
let element = XMLElement(name: name, index: count, options: options)
element.parent = self
count += 1

children.append(element)
Expand Down

0 comments on commit 2eedebf

Please sign in to comment.