Skip to content

Fix: CFXMLNode returns its type code and compares nodes by value - #147

Open
DTW-Thalion wants to merge 1 commit into
gnustep:masterfrom
DTW-Thalion:fix-cfxmlnode-typecode-equal
Open

Fix: CFXMLNode returns its type code and compares nodes by value#147
DTW-Thalion wants to merge 1 commit into
gnustep:masterfrom
DTW-Thalion:fix-cfxmlnode-typecode-equal

Conversation

@DTW-Thalion

Copy link
Copy Markdown
Contributor

Two corrections to CFXMLNode, each verified against Apple CoreFoundation.

CFXMLNodeGetTypeCode returned the runtime flags field, which CFXMLNodeCreate never sets, so every node reported type code 0. It now returns the stored type.

CFXMLNodeEqual fell through to returning false for the node types that carry no additional info (text, comment, CDATA section, whitespace, document fragment) and for attribute-list declarations, so a node never equalled its copy. It now returns true once the type, string and version match and any typed info compares equal.

The tests typecode.m and equal.m fail before these changes and pass after.

@DTW-Thalion
DTW-Thalion force-pushed the fix-cfxmlnode-typecode-equal branch from d0460b0 to e605ab5 Compare July 24, 2026 15:22
@DTW-Thalion DTW-Thalion reopened this Jul 24, 2026
@DTW-Thalion DTW-Thalion reopened this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant