Bug #10351
ProDataSet READ-XML issue when temp-table node is the same as dataset node
100%
Related issues
History
#2 Updated by Teodor Gorghe 12 months ago
- File tt3_tt4_no_root_nested.xml
added - File tt1_tt2_no_root_nested.xml
added
On OE 4GL, you can define XML input files, for static and dynamic datasets, with a structure like this:
<?xml version="1.0"?>
<ttName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ttField1>...</ttField1>
...
</ttName>
On FWD, the following tests fails because it treats the root node as a dataset node and expects the child nodes to be temp-table nodes:
Test logs#3 Updated by Teodor Gorghe 12 months ago
- Status changed from New to WIP
- Assignee set to Teodor Gorghe
Created task branch 10351a.
#5 Updated by Teodor Gorghe 12 months ago
- Status changed from WIP to Review
- % Done changed from 0 to 100
Committed revision 16080 on task branch 10351a:
- DATASET:READ-XML added support for buffer as root node.
The customer app that I have found this issue uses dynamic ProDataSet object with SET-BUFFER call. I don't have a solution for ProDataSet structure infered READ-XML call.
#6 Updated by Teodor Gorghe 12 months ago
- reviewer Constantin Asofiei added
#7 Updated by Teodor Gorghe 12 months ago
Committed revision 16081 on task branch 10351a:
- Added some isRoot = false before break because the next stream node should not be a root node anymore.
#8 Updated by Constantin Asofiei 12 months ago
Teodor, is this related to #10203 ?
#9 Updated by Teodor Gorghe 12 months ago
Constantin Asofiei wrote:
Teodor, is this related to #10203 ?
The testcase that Dennis wrote on #10203 is related with another parsing issue. For that case, I think 4GL implicitly assigns child text node to the only buffer field existent.
This task tells another test case where READ-XML fails. The .xml files attached on #10351-2 shows an example of .xml input file which works on 4GL and the dataset gets populated. On FWD, this fails on trunk rev and I have made this work after 10351a rev 16081.
#10 Updated by Constantin Asofiei 12 months ago
OK, what you found is if the root node does not match the dataset, and is a temp-table (serialized) name, then the root dataset node is skipped.
But I don't understand this part:
if (!tableNameMatch && !dataSetNameMatch)
{ // If the current node is the root node
// and it does not match with a buffer node, continue to the next XML node.
if (isRoot)
{
isRoot = false;
break;
}
Are you saying that if the root node doesn't match either the dataset or temp-table name, then is skipped?
#11 Updated by Teodor Gorghe 12 months ago
Constantin Asofiei wrote:
OK, what you found is if the root node does not match the dataset, and is a temp-table (serialized) name, then the root dataset node is skipped.
But I don't understand this part:
[...]Are you saying that if the root node doesn't match either the dataset or temp-table name, then is skipped?
4GL allows you to specify XML input payload with a root node name different than the dataset serialized name (and is also not a temp-table serialized name). If this does not match with a temp-table name, then the data is populated from his node childs.
This condition was necessary because the dataset XML-NODE-NAME can be empty or unknown and I have found this by running some tests.
#12 Updated by Constantin Asofiei 12 months ago
OK, so if you have something like foo/bar/ in the XMl structure, and neither foo or bar match the temp-table, then it will fail?
#13 Updated by Teodor Gorghe 12 months ago
Constantin Asofiei wrote:
OK, so if you have something like
foo/bar/in the XMl structure, and neither foo or bar match the temp-table, then it will fail?
Yes, it will fail on bar node
#14 Updated by Teodor Gorghe 12 months ago
FWD (error message hidden by READ XML invoke, but is the same error as from 4GL):
testReadXmlFooBar 15010 ms ✘ com.goldencode.p2j.util.DeferredLegacyErrorException
OE 4GL:
TestReadXmlFooBar .001 Dataset name 'ds2' in namespace '' not found in XML Document. (13514)
#15 Updated by Teodor Gorghe 12 months ago
- reviewer Ovidiu Maxiniuc added
- reviewer deleted (
Constantin Asofiei)
Ovidiu, Constantin ran some tests with a P2J build with changes from this branch.
Can you check the changes from this branch and tell to me if there is something that is not right?
#16 Updated by Ovidiu Maxiniuc 12 months ago
I looked at the changes in 10351a. The way I read the lines at 603/606 is that the root node can be anything (including tableNameMatch and dataSetNameMatch) and the XML file processing will continue with inner nodes. Error 13514 will be thrown if one of these cannot be matched, instead.
If this is the expected behaviour (it does not seems logical, but I've seen other strange things in 4GL) and it fixes the original issue, then we should go ahead with testing. I'll let you update the task status and you seem fit.
#17 Updated by Teodor Gorghe 12 months ago
- Status changed from Review to Internal Test
#18 Updated by Alexandru Lungu 11 months ago
Teodor, is this ready to be merged?
#19 Updated by Teodor Gorghe 11 months ago
Yes, now is ready to be merged.
#20 Updated by Constantin Asofiei 11 months ago
- Status changed from Internal Test to Merge Pending
10351a can be merged after 10360a
#21 Updated by Teodor Gorghe 11 months ago
- Status changed from Merge Pending to Test
Branch 10351a was merged to trunk rev 16121 and archived.
#22 Updated by Teodor Gorghe 9 months ago
- Related to Bug #10203: XMLs cannot be imported into a dataset without a schema present added