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-11191] Inconsistent XML Namespace parsing on Linux #3990

Closed
swift-ci opened this issue Jul 23, 2019 · 2 comments
Closed

[SR-11191] Inconsistent XML Namespace parsing on Linux #3990

swift-ci opened this issue Jul 23, 2019 · 2 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-11191
Radar None
Original Reporter drewag (JIRA User)
Type Bug
Status Closed
Resolution Duplicate

Attachment: Download

Environment

Ubuntu 18.04.1 LTS

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

md5: ae382d26a101dfb4ce14aab2f478455c

duplicates:

  • SR-10157 XMLParser swap element names parts under Linux (but not on MacOs)

Issue Description:

XML Elements with namespaces are reported with the namespace after the name on Linux.

For example `<ns:element></ns:element>` gets reported properly as "ns:element" on Apple platforms but "element:ns" on Linux.

This is a minimal example that shows the error (file also attached):

import Foundation

class Parser: NSObject, XMLParserDelegate {
    func parse() {
        let data = "<ns:element></ns:element>".data(using: .utf8)!
        let parser = XMLParser(data: data)
        parser.delegate = self
        parser.parse()
    }

    func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) {
        // Prints "ns:element" on Apple platforms
        // Prints "element:ns" on Linux platforms
        print(elementName)
    }
}

Parser().parse()

This may be related or the same error as SR-10424, but it isn't clear to me what that bug is referring to.

@YOCKOW
Copy link
Collaborator

YOCKOW commented Jul 24, 2019

Isn’t this a dup of SR-10157?

@swift-ci
Copy link
Contributor Author

Comment by Andrew Wagner (JIRA)

Yup, looks like it is.

@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