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
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:
I hope this solves your problem.
Cheers!
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>