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

[question] How to add xml declaration to marshalDocument #191

Open
stefanschenk opened this issue Feb 8, 2018 · 1 comment
Open

[question] How to add xml declaration to marshalDocument #191

stefanschenk opened this issue Feb 8, 2018 · 1 comment

Comments

@stefanschenk
Copy link

Hi,

I just started with jsonix in my project. I succesfully created a mapping from an xsd and I am able to create a marshalDocument.
But whether I use marshalString or marshalDocument, there is no xml declaration (eg. <?xml version="1.0" encoding="UTF-8"?>) present in the generated xml.

I've searched github and stackoverflow, but I'm unable to find an answer on how to add a xml declaration using jsonix.

@stefanschenk stefanschenk changed the title How to add xml declaration to marshalDocument [question] How to add xml declaration to marshalDocument Feb 8, 2018
@highsource
Copy link
Owner

To be honest, I do not know how to do this. Jsonix uses XMLSerializer.serializeToString or node.xml to serialize DOM to string (see Jsonix.DOM.serialize). So I guess XML declaration is not supported yet.

As a workaround you could try to serialize DOM on your own or simply prepend XML declaration to the serialized string.

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

2 participants