Closed LukeFranky closed 5 months ago
Thank you for reporting this issue!I am traveling at the moment but I will take a look at this in a couple of days. On 21. May 2024, at 4.50, LukeFranky @.***> wrote: The Australian Tax Office rejects XBRL with the XML and 'instance-generator' declarations at the top of the file. Please provide an option to disable the declaration output. image-2024-05-21-12-30-25-769.png (view on web)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
Thank you,
I have been able to workaround with the following approach:
var remove = new List<XmlNode>();
XmlDocument doc = this.Instance.ToXmlDocument();
// Identify nodes incompatible with ATO
foreach (XmlNode node in doc)
{
if (node.NodeType == XmlNodeType.XmlDeclaration || node.NodeType == XmlNodeType.ProcessingInstruction)
{
remove.Add(node);
}
}
// Remove nodes incompatible with ATO
foreach (XmlNode node in remove)
{
doc.RemoveChild(node);
}
var settings = new XmlWriterSettings();
settings.OmitXmlDeclaration = true;
settings.Indent = true;
settings.IndentChars = "\t";
settings.NamespaceHandling = NamespaceHandling.OmitDuplicates;
settings.Encoding = Encoding.UTF8;
// Output refined XML
using (XmlWriter writer = XmlWriter.Create(output, settings))
{
doc.WriteTo(writer);
}
This is now fixed in 3.3.0. You can control specific bits of the metadata with report properties:
report.OutputInstanceGenerator = false;
report.OutputTaxonomyVersion = false;
report.OutputXmlDeclaration = false;
report.OutputComments = false;
Wow. That was fast.
Thank you,
Well it was a pretty straightforward fix, let's just hope it does what you need.
The Australian Tax Office rejects XBRL with the XML and 'instance-generator' declarations at the top of the file.
Please provide an option to disable the declaration output.