Hello experts,
I use VS Community 2013 update 5 for working with complex XSD schemas.
It seems that "generate sample XML" contains a bug that will exclude valid elements, in case other elements with same names have been used before in the resulting XML file.
Below are two generated XML samples, second one being subset of the first one. Check the content of <CVPerson>, valid elements <ID> and <Name> are present in second sample, but are missing in first, probably because <ID> and <Name>
have been used in <UBLExtension> nodes.
Also, elements <InstitutionPlaceOfStayLegalEntity>, <HealthCareProviderLegalEntity>, <CompetentInstitutionLegalEntity>
in the end of first sample, are of the same type and should have same subelements, which is not the case.
Am I making sense, is it a bug or I am missing something?
<?xml version="1.0" encoding="utf-8"?><PRCRequest xmlns="urn:e-SENS:e-Confirmation:prc:xsd:PRCRequest"><UBLExtensions xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"><UBLExtension><ID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ID1</ID><Name languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Name1</Name><ExtensionAgencyID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1">ExtensionAgencyID1</ExtensionAgencyID><ExtensionAgencyName languageID="en" languageLocaleID="languageLocaleID1">ExtensionAgencyName1</ExtensionAgencyName><ExtensionVersionID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1">ExtensionVersionID1</ExtensionVersionID><ExtensionAgencyURI schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1">ExtensionAgencyURI1</ExtensionAgencyURI><ExtensionURI schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1">ExtensionURI1</ExtensionURI><ExtensionReasonCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1">ExtensionReasonCode1</ExtensionReasonCode><ExtensionReason languageID="en" languageLocaleID="languageLocaleID1">ExtensionReason1</ExtensionReason><ExtensionContent><any_element xmlns="otherNS">anyType</any_element></ExtensionContent></UBLExtension><UBLExtension><ID schemeID="schemeID2" schemeName="schemeName2" schemeAgencyID="schemeAgencyID2" schemeAgencyName="schemeAgencyName2" schemeVersionID="schemeVersionID2" schemeDataURI="http://uri2" schemeURI="http://uri2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ID2</ID><Name languageID="fr" languageLocaleID="languageLocaleID2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Name2</Name><ExtensionAgencyID schemeID="schemeID2" schemeName="schemeName2" schemeAgencyID="schemeAgencyID2" schemeAgencyName="schemeAgencyName2" schemeVersionID="schemeVersionID2" schemeDataURI="http://uri2" schemeURI="http://uri2">ExtensionAgencyID2</ExtensionAgencyID><ExtensionAgencyName languageID="fr" languageLocaleID="languageLocaleID2">ExtensionAgencyName2</ExtensionAgencyName><ExtensionVersionID schemeID="schemeID2" schemeName="schemeName2" schemeAgencyID="schemeAgencyID2" schemeAgencyName="schemeAgencyName2" schemeVersionID="schemeVersionID2" schemeDataURI="http://uri2" schemeURI="http://uri2">ExtensionVersionID2</ExtensionVersionID><ExtensionAgencyURI schemeID="schemeID2" schemeName="schemeName2" schemeAgencyID="schemeAgencyID2" schemeAgencyName="schemeAgencyName2" schemeVersionID="schemeVersionID2" schemeDataURI="http://uri2" schemeURI="http://uri2">ExtensionAgencyURI2</ExtensionAgencyURI><ExtensionURI schemeID="schemeID2" schemeName="schemeName2" schemeAgencyID="schemeAgencyID2" schemeAgencyName="schemeAgencyName2" schemeVersionID="schemeVersionID2" schemeDataURI="http://uri2" schemeURI="http://uri2">ExtensionURI2</ExtensionURI><ExtensionReasonCode listID="listID2" listAgencyID="listAgencyID2" listAgencyName="listAgencyName2" listName="listName2" listVersionID="listVersionID2" name="name2" languageID="fr" listURI="http://uri2" listSchemeURI="http://uri2">ExtensionReasonCode2</ExtensionReasonCode><ExtensionReason languageID="fr" languageLocaleID="languageLocaleID2">ExtensionReason2</ExtensionReason><ExtensionContent><any_element xmlns="otherNS">anyType</any_element></ExtensionContent></UBLExtension><UBLExtension><ID schemeID="schemeID3" schemeName="schemeName3" schemeAgencyID="schemeAgencyID3" schemeAgencyName="schemeAgencyName3" schemeVersionID="schemeVersionID3" schemeDataURI="http://uri3" schemeURI="http://uri3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ID3</ID><Name languageID="de" languageLocaleID="languageLocaleID3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Name3</Name><ExtensionAgencyID schemeID="schemeID3" schemeName="schemeName3" schemeAgencyID="schemeAgencyID3" schemeAgencyName="schemeAgencyName3" schemeVersionID="schemeVersionID3" schemeDataURI="http://uri3" schemeURI="http://uri3">ExtensionAgencyID3</ExtensionAgencyID><ExtensionAgencyName languageID="de" languageLocaleID="languageLocaleID3">ExtensionAgencyName3</ExtensionAgencyName><ExtensionVersionID schemeID="schemeID3" schemeName="schemeName3" schemeAgencyID="schemeAgencyID3" schemeAgencyName="schemeAgencyName3" schemeVersionID="schemeVersionID3" schemeDataURI="http://uri3" schemeURI="http://uri3">ExtensionVersionID3</ExtensionVersionID><ExtensionAgencyURI schemeID="schemeID3" schemeName="schemeName3" schemeAgencyID="schemeAgencyID3" schemeAgencyName="schemeAgencyName3" schemeVersionID="schemeVersionID3" schemeDataURI="http://uri3" schemeURI="http://uri3">ExtensionAgencyURI3</ExtensionAgencyURI><ExtensionURI schemeID="schemeID3" schemeName="schemeName3" schemeAgencyID="schemeAgencyID3" schemeAgencyName="schemeAgencyName3" schemeVersionID="schemeVersionID3" schemeDataURI="http://uri3" schemeURI="http://uri3">ExtensionURI3</ExtensionURI><ExtensionReasonCode listID="listID3" listAgencyID="listAgencyID3" listAgencyName="listAgencyName3" listName="listName3" listVersionID="listVersionID3" name="name3" languageID="de" listURI="http://uri3" listSchemeURI="http://uri3">ExtensionReasonCode3</ExtensionReasonCode><ExtensionReason languageID="de" languageLocaleID="languageLocaleID3">ExtensionReason3</ExtensionReason><ExtensionContent><any_element xmlns="otherNS">anyType</any_element></ExtensionContent></UBLExtension></UBLExtensions><UBLVersionID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">UBLVersionID1</UBLVersionID><CustomizationID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">CustomizationID1</CustomizationID><ProfileID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ProfileID1</ProfileID><ProfileExecutionID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ProfileExecutionID1</ProfileExecutionID><UUID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">UUID1</UUID><IssueDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</IssueDate><IssueTime xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">01:01:01</IssueTime><PersonConsentCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">PersonConsentCode1</PersonConsentCode><RequestedValidityPeriod xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"><StartDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</StartDate><StartTime xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">01:01:01</StartTime><EndDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</EndDate><EndTime xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">01:01:01</EndTime><DurationMeasure unitCode="unitCode1" unitCodeListVersionID="unitCodeListVersionID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1</DurationMeasure><DescriptionCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode1</DescriptionCode><DescriptionCode listID="listID2" listAgencyID="listAgencyID2" listAgencyName="listAgencyName2" listName="listName2" listVersionID="listVersionID2" name="name2" languageID="fr" listURI="http://uri2" listSchemeURI="http://uri2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode2</DescriptionCode><DescriptionCode listID="listID3" listAgencyID="listAgencyID3" listAgencyName="listAgencyName3" listName="listName3" listVersionID="listVersionID3" name="name3" languageID="de" listURI="http://uri3" listSchemeURI="http://uri3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode3</DescriptionCode><Description languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description1</Description><Description languageID="fr" languageLocaleID="languageLocaleID2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description2</Description><Description languageID="de" languageLocaleID="languageLocaleID3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description3</Description></RequestedValidityPeriod><InsuredPerson xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/AggregateComponents"><DocumentTypeCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DocumentTypeCode1</DocumentTypeCode><DocumentID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DocumentID1</DocumentID><DocumentExpiryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</DocumentExpiryDate><InsuranceID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">InsuranceID1</InsuranceID><EuropeanHealthInsuranceCardID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">EuropeanHealthInsuranceCardID1</EuropeanHealthInsuranceCardID><EuropeanHealthInsuranceCardExpiryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</EuropeanHealthInsuranceCardExpiryDate><CertificateDeliveryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</CertificateDeliveryDate><CertificateValidityPeriod /><CVPerson><BirthName languageID="en" languageLocaleID="languageLocaleID1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">BirthName1</BirthName><FamilyName languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">FamilyName1</FamilyName><GivenName languageID="en" languageLocaleID="languageLocaleID1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">GivenName1</GivenName><BirthDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</BirthDate></CVPerson></InsuredPerson><InstitutionPlaceOfStayLegalEntity xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/AggregateComponents"><LegalID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">LegalID1</LegalID><RegisteredCVAddress><AdminunitFirstline languageID="en" languageLocaleID="languageLocaleID1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">AdminunitFirstline1</AdminunitFirstline></RegisteredCVAddress></InstitutionPlaceOfStayLegalEntity><HealthCareProviderLegalEntity xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/AggregateComponents" /><CompetentInstitutionLegalEntity xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/AggregateComponents" /></PRCRequest>
<?xml version="1.0" encoding="utf-8"?><InsuredPerson xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/AggregateComponents"><DocumentTypeCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DocumentTypeCode1</DocumentTypeCode><DocumentID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DocumentID1</DocumentID><DocumentExpiryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</DocumentExpiryDate><InsuranceID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">InsuranceID1</InsuranceID><EuropeanHealthInsuranceCardID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">EuropeanHealthInsuranceCardID1</EuropeanHealthInsuranceCardID><EuropeanHealthInsuranceCardExpiryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</EuropeanHealthInsuranceCardExpiryDate><CertificateDeliveryDate xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">1900-01-01</CertificateDeliveryDate><CertificateValidityPeriod><StartDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</StartDate><StartTime xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">01:01:01</StartTime><EndDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</EndDate><EndTime xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">01:01:01</EndTime><DurationMeasure unitCode="unitCode1" unitCodeListVersionID="unitCodeListVersionID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1</DurationMeasure><DescriptionCode listID="listID1" listAgencyID="listAgencyID1" listAgencyName="listAgencyName1" listName="listName1" listVersionID="listVersionID1" name="name1" languageID="en" listURI="http://uri1" listSchemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode1</DescriptionCode><DescriptionCode listID="listID2" listAgencyID="listAgencyID2" listAgencyName="listAgencyName2" listName="listName2" listVersionID="listVersionID2" name="name2" languageID="fr" listURI="http://uri2" listSchemeURI="http://uri2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode2</DescriptionCode><DescriptionCode listID="listID3" listAgencyID="listAgencyID3" listAgencyName="listAgencyName3" listName="listName3" listVersionID="listVersionID3" name="name3" languageID="de" listURI="http://uri3" listSchemeURI="http://uri3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">DescriptionCode3</DescriptionCode><Description languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description1</Description><Description languageID="fr" languageLocaleID="languageLocaleID2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description2</Description><Description languageID="de" languageLocaleID="languageLocaleID3" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Description3</Description></CertificateValidityPeriod><CVPerson><BirthName languageID="en" languageLocaleID="languageLocaleID1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">BirthName1</BirthName><FamilyName languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">FamilyName1</FamilyName><GivenName languageID="en" languageLocaleID="languageLocaleID1" xmlns="http://www.esens.eu/ns/e-Confirmation/PRCCommon/BasicComponents">GivenName1</GivenName><Name languageID="en" languageLocaleID="languageLocaleID1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">Name1</Name><BirthDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">1900-01-01</BirthDate><ID schemeID="schemeID1" schemeName="schemeName1" schemeAgencyID="schemeAgencyID1" schemeAgencyName="schemeAgencyName1" schemeVersionID="schemeVersionID1" schemeDataURI="http://uri1" schemeURI="http://uri1" xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">ID1</ID></CVPerson></InsuredPerson>