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

XML Writer #734

Closed
norberttech opened this issue Nov 5, 2023 · 4 comments · Fixed by #1166
Closed

XML Writer #734

norberttech opened this issue Nov 5, 2023 · 4 comments · Fixed by #1166

Comments

@norberttech
Copy link
Member

Currently, Flow can only read XML, but we should start looking into saving XML files as well.

There are two libraries that could help us achieve that:

Before actual coding, we should first look into converting Rows into XML, we will need to figure out how to determine what should be saved as a value and what should be saved as an attributes.

@norberttech norberttech converted this from a draft issue Nov 5, 2023
@norberttech norberttech added this to the 0.6.0 milestone Nov 6, 2023
@stloyd
Copy link
Member

stloyd commented Dec 30, 2023

Right now we are not able to implement veewee/xml package due to fact that it's using internally \DOMDocument class which cannot be serialized since PHP 8.1:

Exception: Serialization of 'DOMDocument' is not allowed, unless serialization methods are implemented in a subclass
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/Serializer/NativePHPSerializer.php:17
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/Serializer/CompressingSerializer.php:28
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/Cache/LocalFilesystemCache.php:50
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/Pipeline/CachingPipeline.php:67
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/DataFrame.php:739
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/DataFrame.php:774

Second library is unfortunately also not possible to use due to fact it internally uses package array-to-xml which requires to pass whole array of data at once.

@stloyd stloyd moved this from Todo to On Hold in Roadmap Dec 30, 2023
@norberttech
Copy link
Member Author

Exception: Serialization of 'DOMDocument' is not allowed, unless serialization methods are implemented in a subclass
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/Serializer/NativePHPSerializer.php:17
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/Serializer/CompressingSerializer.php:28
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/Cache/LocalFilesystemCache.php:50
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/Pipeline/CachingPipeline.php:67
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/DataFrame.php:739
/Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/DataFrame.php:774

This should be solvable by implementing custom serialization logic in XMLEntry::__serialize() and XMLEntry::__unserialize() methods().
XML should be dumped to string and then loaded from string during unserialization.
I wasn't even aware that DOMDocument is not serializable 🤦‍♂️

@norberttech
Copy link
Member Author

This task should be unblocked now due to #896

@stloyd stloyd moved this from On Hold to In Progress in Roadmap Jan 8, 2024
@norberttech norberttech moved this from In Progress to Todo in Roadmap Jan 18, 2024
@norberttech
Copy link
Member Author

First attempt: #903

@norberttech norberttech modified the milestones: 0.6.0, 0.7.0 Feb 9, 2024
@norberttech norberttech removed this from the 0.7.0 milestone Mar 11, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants