[XML Records] AddDeclaration to Xml

[XML Records] AddDeclaration to Xml

  
Forge Component
(24)
Published on 15 Jun by Ricardo Silva
24 votes
Published on 15 Jun by Ricardo Silva
Maybe someone can explain why I don't get a declaration added to the xml when I set the AddDeclaration to True in the XmlDeclaration Record of the DefaultXmlConfig Record?
Hello Wayne,

I imagine you're using XMLRecords in the Java version as it is the only one which did not have the code to allow outputting xml declaration.

I have fixed that in version 1.5.4 of the XML Records component. Please check if it fits your needs.
Thank you! It works fine

And Yes, I am using the Java version. I had done a workaround by doing a replace on the first tag to add it in but have removed it in favor of the config option.

Thanks again for your help,
Wayne
Hey Ricardo,

First of all, thanks for the extension :)

I'm having issues with the AddDeclaration attribute for the DefaultXMLConfig on .NET. Despite defining it as True, it doesn't get generated.

May it be because I'm using the AddRootNode paramenter as true when generating it? If I don't, I get an error: "There are multiple root elements."

I'm using a variable A that's a record list of type B. So I was expecting to have it generating something like:

<A>
<B />
<B />
</A>

Thanks,
Armando