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

Same options from Parser to Builder produce a different output #508

Open
Alex-Ferreli opened this issue Apr 11, 2019 · 7 comments
Open

Same options from Parser to Builder produce a different output #508

Alex-Ferreli opened this issue Apr 11, 2019 · 7 comments

Comments

@Alex-Ferreli
Copy link

Hi! I'm trying to parse, manipulate, and build an XML file.

I found the option to create an array of child (to maintain the order in built XML file), so i use it. But when i generate back the XML seems like tat the builder didn't see the options, so he generate a totally different output (put children as XML node, but should loop over them and generate the right tags).

It's possible that Builder didn't accept the same options as Parser?

Thanks in advance!

@Leonidas-from-XIV
Copy link
Owner

Yes, I don't think the code is well suited for roundtrips. The builder should just be removed :-(

@Alex-Ferreli
Copy link
Author

Then there is now way to re-generate a correct XML? :(

Do you know some great alternative of your plugin? This is so good because is ridiculously easy to use, to read XML it's fantastic. The problem is only for the generation of XML with ordered childrens :(

@Leonidas-from-XIV
Copy link
Owner

Well, you can still use xml2js for parsing and construct XML in a different way.

xml2js is due for a proper rewrite but since I don't use it personally I have little time to spend on it.

@Alex-Ferreli
Copy link
Author

Yes, i'm still using it to parsing.

I wrote a function that loop over an element (attributes and childrens) and generate full XML.

@brospars
Copy link

brospars commented Aug 4, 2020

@Alex-Ferreli Would you mind sharing it ?

@brospars
Copy link

brospars commented Aug 6, 2020

Nevermind #461 works great

@chpio
Copy link

chpio commented Apr 12, 2021

Can we get #461 merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants