Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-9069] XMLDocument(xmlString:) produces nodes with kind .invalid instead of .text on Linux #3610

Closed
benlangmuir opened this issue Oct 23, 2018 · 1 comment

Comments

@benlangmuir
Copy link
Member

Previous ID SR-9069
Radar None
Original Reporter @benlangmuir
Type Bug
Status Resolved
Resolution Duplicate
Environment

Ubuntu 18.04, corelibs Foundation from Swift-4.2

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: 4b0f476addab02fde52e3daf2bbeaa54

is duplicated by:

  • SR-10717 [XMLNode] var kind: XMLNode.Kind { get } returns an incorrect value on Linux.

Issue Description:

Whenever I use XMLDocument(xmlString:) on Linux, text nodes have kind .invalid

import Foundation
let doc = try! XMLDocument(xmlString: "<item>foo</item>")
let node = doc.rootElement()!
let child = node.children![0]
print("child.kind: \(child.kind)")
print("child.kind.rawValue: \(child.kind.rawValue)")
print("child.kind == .text: \(child.kind == .text)")
print("child.kind == .invalid: \(child.kind == .invalid)")

Linux output (looks wrong):

child.kind: invalid
child.kind.rawValue: 0
child.kind == .text: false
child.kind == .invalid: true

macOS output (looks okay):

child.kind: NSXMLNodeKind
child.kind.rawValue: 7
child.kind == .text: true
child.kind == .invalid: false
@YOCKOW
Copy link
Collaborator

YOCKOW commented Jun 12, 2019

Sorry, I didn't noticed SR-10717 is a dup of this.
Anyway, it has been already fixed in master.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants