Another quick question:
I have created an XMLPort to export some data as an XML file. The schema that I am following repeats the names of the Attributes for a number of different tags. As a compensation for this, I have used some global variables as datasources (which all become populated correctly when I debug the process). However the file that results from this XMLPort has blank tags wherever these variables are used as the datasource
I suspect that it may not be possible to create an XMLPort using global variables and/or using the same attribute names across an XML file.
Has someone experienced this problem before? and if so, is there a workaround??
Many Thanx
0
Comments
You can have the same name for an attribute for more than one element. You can have an element called 'Customer', with an attribute 'Name', and another element called 'Vendor', also with an attribute called 'Name'. It is even technically possible to have the same name element when they are nested (it shouldn't be possible but some parsers don't cause exceptions when that happens), but that is not well formed XML.
So you could have an attribute called Name under two elements, and as the source you will need to set the variables. Now it becomes your task to make sure that you populate those variables before the xml is exported.
RIS Plus, LLC
I am using the XML designer to fill out Tagnames, Element Types and Datasources (which works up until I enter an identical datasource name within the designer - then I get a variable is defined twice error).
So I compensate and define global variables to hold the datasource value (assigning the value in the Export::OnBeforPassField trigger), thinking that this will work. But when I run the XMLPort all the tags which I defined with a datasource of a global variable, these show up as blank tags (tags with no values between them)
I need to keep the tag names as they are (as they are that way in the schema that I need to follow). Has anyone had this issue before? Can anyone help?
Thanks. :?
For variable defined twice error. Change the Datasource. So if you have two elements with same name NAV gives it the same name to the datasource. So remove <> and add a 1 or 2 at the end of the datasource.
XMLPort are a little different in that you don't need global variable the datasource is created as variable if it sourcetype is Text
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n