How to Remove XML Tag from navision?


Can anyone of tell me how to remove the xml tag from navision? I used to generate a xml document and storing in my local. I need to remove one xml tag that does not have a value . so please suggest me for do this.


Hi @pjllaneras can you help me out of this?


To remove an XML tag from a Navision-generated XML document, you can use an XML parser or an XML editor tool. Here are the general steps you can follow:

  1. Open the XML document using an XML editor or a text editor that supports XML syntax highlighting.
  2. Locate the XML tag that you want to remove. Check if the tag has any attributes or child nodes.
  3. Delete the entire XML tag, including the opening and closing tags and any attributes or child nodes associated with it.
  4. Save the modified XML document.

Note that deleting an XML tag can affect the structure and integrity of the XML document. Therefore, it is advisable to make a backup copy of the original XML document before making any changes. Additionally, make sure that you are not removing any essential data or tags that are required for processing the XML document correctly.

Hi @Rajan_Rajan,

Did you resolve this problem?

How do you generate this xml file? Have you created a process (codeunit or report) to create xml?

This is for C/AL or AL extension (you mention “navision”, and this is a bit confusion about the programming language used).

If you use xmldocument and other xml vars you can control what to put in the xml document. In case the xml document is created in advance, you can parse the XML file with this vars and remove the elements that you don’t need.

For AL check this page: XmlNode.Remove() Method - Business Central | Microsoft Learn

hi @pjllaneras ,
very happy to text with you.
using xmldocument(Dotnet variable) i removed the tag which is emplty. i have tried with codeunit and resolved the issues.