IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: sudharshan
About
User Name: sudharshan
Forum Rank: Newbie
Real Name:
Location India
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Friday, March 26, 2021
Last Visit: Friday, March 26, 2021 6:39:01 AM
Number of Posts: 1
[0.01% of all post / 0.01 posts per day]
Avatar
Last 10 Posts
Topic: Optimized solution for Mandatory validation in parent child input xml
Posted: Friday, March 26, 2021 6:28:00 AM
Description

Step1: Please open the given mfd and refer Screenshot 1.

Step2: So if we go inside Validationchildparent udf, you can find itemValidationParentCheck(Screenshot 2).

Step3: Inside itemValidationParentCheck We can find the main logic for conditional and mandatory logic for group as I said earlier.(Screenshot 3).

Step4: We can find the TotalDutiableQuantity under ItemQuantity, TotalDutiableQuantity Is conditional whereas unitcode id mandatory according to specs(Screenshot 4).

Step5: Our requirement is we need to perform validation on this parent child relationship, for instance if the parent is present in input xml then we need to go and check the mandatory child(and throw exceptions if no data or tag is their) or else we don't need to check.

Step6: But the issue here is the whole group is repeating, the item in which the TotalDutiableQuantity is present will repeat for 50 times. Refer Screenshot 6 and 7.

Step7: So the validations what we implemented for this parent child is not working feasibly, can anyone suggest a optimized one.

Steps To Reproduce:

step 1: open the mfd file

step 2: add the xsd from the zip file(Input XSD\TN Spec for SDC\TradenetResponse.xsd)

step 3: add the json schema from the zip file(Output Json Schema\Jsonschema..json)

step 4: Add input file from the zip file(Input\DUMMY_T08GA0029H202102095041_TDBI038_INPPMT.xml)

step 5: Generate output -> Exceptions are not thrown clearly if you delete the tag or data in input xml

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.