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

Support for mixed-content nodes #157

Merged
merged 2 commits into from Dec 17, 2019

Conversation

ultramiraculous
Copy link
Contributor

Adding support for nodes with mixed content, where loose text nodes might coexist with other node types. An example of this in the tests is: <container>first<b>bold text</b>second</container>.

This restructures the contents of nodes, so that raw text is always stored in a ""-keyed node, which can occur multiple times if necessary. Previously all text nodes were appended together into the element's value, so their order relative to elements between them was lost.

Tests/XMLCoderTests/Minimal/MixedContentTests.swift Outdated Show resolved Hide resolved
Tests/XMLCoderTests/Minimal/MixedContentTests.swift Outdated Show resolved Hide resolved
Tests/XMLCoderTests/Minimal/MixedContentTests.swift Outdated Show resolved Hide resolved
Tests/XMLCoderTests/Minimal/MixedContentTests.swift Outdated Show resolved Hide resolved
Tests/XMLCoderTests/Minimal/MixedContentTests.swift Outdated Show resolved Hide resolved
Sources/XMLCoder/Auxiliaries/XMLCoderElement.swift Outdated Show resolved Hide resolved
Sources/XMLCoder/Auxiliaries/XMLCoderElement.swift Outdated Show resolved Hide resolved
Sources/XMLCoder/Auxiliaries/XMLCoderElement.swift Outdated Show resolved Hide resolved
Sources/XMLCoder/Auxiliaries/XMLCoderElement.swift Outdated Show resolved Hide resolved
Sources/XMLCoder/Auxiliaries/XMLCoderElement.swift Outdated Show resolved Hide resolved
Copy link
Collaborator

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work! Thank you 🙏

@MaxDesiatov
Copy link
Collaborator

For some reason Azure Pipelines status is not reported to GitHub now, but the CI job has passed. I assume the issue with this is intermittent and going to merge it as is.

@MaxDesiatov MaxDesiatov self-assigned this Dec 17, 2019
@MaxDesiatov MaxDesiatov added the enhancement New feature or request label Dec 17, 2019
@MaxDesiatov MaxDesiatov merged commit af55684 into CoreOffice:master Dec 17, 2019
arjungupta0107 pushed a commit to salido/XMLCoder that referenced this pull request Jun 26, 2020
Adding support for nodes with mixed content, where loose text nodes might coexist with other  node types. An example of this in the tests is: `<container>first<b>bold text</b>second</container>`.

This restructures the contents of nodes, so that raw text is always stored in a `""`-keyed node, which can occur multiple times if necessary. Previously all text nodes were appended together into the element's `value`, so their order relative to elements between them was lost.

* Support for mixed-content node contents
* Attempt at avoiding force cast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants