microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
737 stars 243 forks source link

XmlPort Namespaces Missing #2183

Closed PedroLReis closed 6 years ago

PedroLReis commented 6 years ago

Hi,

I've created a XMLPort to generate a XML file with multiple namespaces; however, when the file is generated no namesspaces are outputted.

My VS code for the XMLPort looks like this:

xmlport 12070770 "Sales Inv." {

Direction = Export;
Encoding = UTF8;
Namespaces = ""   ='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2',
             cac  ='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2',
             cbc  ='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2',
             ccts ='urn:un:unece:uncefact:documentation:2',
             qdt  ='urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2',
             udt  ='urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2',
             pag  ='http://www.xxxxxxxxxx.com/invoice';
Format = Xml;
UseDefaultNamespace = false;
FormatEvaluate = Xml;

schema
{
    tableelement(invoiceheaderloop;Integer)
    {
        MaxOccurs = Once;
        XmlName = 'Invoice';

        SourceTableView = SORTING(Number) WHERE(Number=FILTER(1..));
        textelement(UBLVersionID)
         {
            NamespacePrefix = 'cbc';

The XmlPort outputs the following XML;

image

And I would like the ouput to be like this;

image

This development is for Nav 2018 build 19394 with the version of "VSIX 0.12.15355", later this development will be used with D365BC.

Is this a bug, am I overlooking something or is it not possible to use multiple namespaces with this version of AL/NAV?

doivosevic commented 6 years ago

Hi. This was a bug and should be backported in build 20397 to Nav on prem and should already be fixed in latest BC

PedroLReis commented 6 years ago

Thank you, I can confirm that this issue is resolved in Nav 2018 from CU3 (Build 20783) and onwards.