Add a namespace

fabou3377fabou3377 Member Posts: 11
Hi,

i want export a xmffile from Navsion with a namespace. I need a namespace for a another application. I can't just add it. The file is created but without lines...


Thanks for your furture help.
IF ISCLEAR(xmlDom) THEN
 CREATE(xmlDom);

tempTable.PICTURE.CREATEOUTSTREAM(xmlOutStream);

xmlOutStream.WRITETEXT('<item xmlns="http://lalima"');

//XMLPORT.EXPORT(XMLPORT::"itemlalima",xmlOutStream,item);

tempTable.INSERT();

tempTable.Picture.CREATEOUTSTREAM(xmlOutStream);

xmlDom.load(xmlOutStream);

xmlDom.save('C:\temp\items.xml');

Comments

  • NagiNagi Member Posts: 151
    Hello fabou3377,

    Adding a namespace to an XML export is quite easy. You have to do it in the XML port designer. Add an attribute to the first element in your XML port (in your case, it would be an attribute called xmlns). The attribute must be indented and source type text. Data source could be just about anything, but xmlns1 seems logical. Next, in the OnPreXMLport trigger you write the following code:
    xmlns1 := 'http://lalima';
    

    I hope this solves your problem.

    Cheers!
  • DeviDevi Member Posts: 8
    I am trying to do data integration for purchase header table from navision.


    first i created an xmlport to export the data out of navision

    now i want to import some data through xmlport into purchase header,
    but it is gving error ....regarding some namespace...schema is not there

    i dont know how to create xml file for import.
    can anyone pls tell me

    the xmlport i created for export is like this ...
    afterwards what to do to import different data
    <?xml version="1.0" encoding="UTF-16" standalone="no" ?>
    - <Purchaseheader>
    - <Purchase_Header MBS_Navision_URL="navision://client/run?servername=nav%26database=databasename%201135%26company=companyname%26servertype=MSSQL%26target=Form%2050%26view=SORTING(Field1)%26position=Field1=0(1),Field3=0(1)">
    <Document_Type>Order</Document_Type>
    <Document_Number>1</Document_Number>
    <Number>1</Number>
    <Name>SMART TECHNOLOGIES</Name>
    <Address>#10/2, VICTORIA ROAD</Address>
    <Address2>NARENDRA PLAZA</Address2>
    </Purchase_Header>
Sign In or Register to comment.