We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Swift-corelibs-foundation:
97bfd79
Darwin Foundation:
macOS 10.15.2 (19C57)
Xcode 11.3.1 (11C504)
md5: c60cd4ad2b138e7548d0599e363d1c2a
Issue Description:
The swift-corelibs-foundation version of XML DTDs are just entirely broken.
1. Root document not set
let typedefs = XMLDTD() let document = XMLDocument(rootElement: nil) document.dtd = typedefs print(typedefs.rootDocument) // nil -- huh?
This is the same on both Darwin and SCF, but it definitely looks like a bug.
2. Children not set
This means that basic entity substitutions (`&author;` -> "Robert Thompson") also do not work on SCF.
let typedefs = XMLDTD() let ent = XMLNode.dtdNode(withXMLString:"<!ENTITY author 'Robert Thompson'>") as! XMLDTDNode typedefs.addChild(ent) let document = XMLDocument(rootElement: nil) document.dtd = typedefs print(typedefs.childCount) print(typedefs.children?.count) print("-----") print(document)
SCF output (note that childCount != children.count):
0 Optional(1) ----- <?xml version="1.0" encoding="utf-8" standalone="no"?> <!DOCTYPE PUBLIC "" "">
Darwin output:
1 Optional(1) ----- <!DOCTYPE [ <!ENTITY author "Robert Thompson"> ]>
3. Adding copies of nodes crashes
let typedefs = XMLDTD() let ent = XMLNode.dtdNode(withXMLString:"<!ENTITY author 'Robert Thompson'>") as! XMLDTDNode typedefs.addChild(ent) typedefs.addChild(ent.copy() as! XMLNode) print(typedefs)
SCF output:
Crash in CFXMLInterface.c:_CFXMLNodeGetPrivateData (node is a null pointer)
Darwin output (no crash):
<!ENTITY author "Robert Thompson"> <!ENTITY (null) "Robert Thompson">
4. Makes a copy of the DTD node when it shouldn't
(note: we're using children.count rather than childCount to work around #2)
let document = XMLDocument(rootElement: nil) let typedefs = XMLDTD() document.dtd = typedefs let ent = XMLNode.dtdNode(withXMLString:"<!ENTITY author 'Robert Thompson'>") as! XMLDTDNode typedefs.addChild(ent) print(document.dtd) print(document.dtd?.children?.count)
Optional(<!DOCTYPE PUBLIC "" "">) Optional(0)
Optional( <!ENTITY author "Robert Thompson"> ) Optional(1)
The text was updated successfully, but these errors were encountered:
@swift-ci create
Sorry, something went wrong.
No branches or pull requests
Environment
Swift-corelibs-foundation:
97bfd79
Darwin Foundation:
macOS 10.15.2 (19C57)
Xcode 11.3.1 (11C504)
Additional Detail from JIRA
md5: c60cd4ad2b138e7548d0599e363d1c2a
Issue Description:
The swift-corelibs-foundation version of XML DTDs are just entirely broken.
1. Root document not set
This is the same on both Darwin and SCF, but it definitely looks like a bug.
2. Children not set
This means that basic entity substitutions (`&author;` -> "Robert Thompson") also do not work on SCF.
SCF output (note that childCount != children.count):
Darwin output:
3. Adding copies of nodes crashes
SCF output:
Darwin output (no crash):
4. Makes a copy of the DTD node when it shouldn't
(note: we're using children.count rather than childCount to work around #2)
SCF output:
Darwin output:
The text was updated successfully, but these errors were encountered: