Suppose you need to export this: <whatever/><whatever>Z<whatever>
You don't know how many "whatever" elements you will have at design time, so you need to make them dynamic. That makes a temp table. No, integer table and filtering does not work, so what do you do, you dynamically insert as many records as needed into a temp table. So you have a Table element named WHATEVER, the temp table is for example TWhatever(Item) in the DataSource.
In for example OnPreXml you you say TWhatever."no." :='1'; TWhhatever.Description := ''; TWhatever.INSERT; TWhatever."no." :='2'; TWhhatever.Description := 'Z'; TWhatever.INSERT;
And in OnAfterGetRecord you say WHATEVER := TWhatever.Description. Right? This should work?
Except this does not do anything you will export two empty elements. It will ignore the assignment to the table element.
This is very serious. Basically it means you can realize 20 days into a large XML project that XMLports cannot fulfill certain specs. Basically you cannot build fully dynamic XML. You cannot repeat a final element arbitrary times - only an element that has children only but no data itself.
Or is there a way? Other than XMLDOM manipulation? That is very ugly, hardcodes something that could be data driven.
0
Comments
<ReferenceInfo>REF001</ReferenceInfo>
<ReferenceInfo>REF002</ReferenceInfo>
<ReferenceInfo>...</ReferenceInfo>
My workaround is to specify 20 elements , sourcetype :text, datasource: ReferenceInfo1, ... ,ReferenceInfo20
and afterwards deleting the empty nodes :-(
I chosed for using the XML port because I have to handle a huge xml structure. In this way I have a clear overview of the tags.
But there are some restrictions!
Also it would be a nice feature that a XML port does not write empty tags!