Remove namespace in xml nav 2013r2

EnesEnes Member Posts: 6
Hi,

I want remove namespace in following xml. Any tips will be helpfull.
Version : Nav2013r2 and upper

I applied following links solution but it didnt work.
https://rockwithnav.wordpress.com/tag/remove-namespace-web-service-response-automation-variable/


<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="aktaes.xslt"?>
<Invoice xmlns:ds="http://www.w3.org/2000/09/xmldsig#&quot; xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" xmlns:cctc="urn:un:unece:uncefact:documentation:2" xmlns:ubltr="urn:oasis:names:specification:ubl:schema:xsd:TurkishCustomizationExtensionComponents" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#&quot; xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
<cbc:UBLVersionID>2.1</cbc:UBLVersionID>
<cbc:CustomizationID>TR1.2</cbc:CustomizationID>
<cbc:ProfileID>TICARIFATURA</cbc:ProfileID>
<cbc:ID>EGT2016000000006</cbc:ID>
<cbc:CopyIndicator>false</cbc:CopyIndicator>
<cbc:UUID>afa0e38b-eb63-558a-e511-77c3a0473501</cbc:UUID>
<cbc:IssueDate>2016-01-25</cbc:IssueDate>
</Invoice>

Best Answer

Answers

  • vnhackvnhack Member Posts: 9

    //DELETE ROOT NODE
    RootNode := '<?xml version="1.0" encoding="utf-8" standalone="no"?>';
    xml := DELSTR(xml,1, STRLEN(RootNode));
  • EnesEnes Member Posts: 6
    Hi vnhack,

    I tried but didnt work. Applied followink links.
    Link : https://rockwithnav.wordpress.com/2016/03/29/remove-namespace-web-service-response-dotnet-variable/


    I get this error;
    Cannot serialize an instance of the following .NET Framework object: assembly Microsoft.MSXML, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, type MSXML.DOMDocumentClass.
  • EnesEnes Member Posts: 6
    Hi Ayhan,

    Thanks for your help.
    I just want to remind that were 2 minor problems.
    First I had to remove semicolons
    second I added following line in order to preserve attributes
    XSLTString := XSLTString + '<xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>';
Sign In or Register to comment.