XSD optional element with tag name












1















Am building an XSD for a flat file, the XSD have two elements delimited by new line:




  • FirstElement_AAA: Repeating but optional with tag name (AAA,).

  • SecondElement_BBB: Single and Mandatory with tag name (BBB,).


So the XSD should support a flat file like:



AAA,
AAA,
BBB,


or



AAA,
BBB,


or



BBB,


The current XSD that i have:



<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://xxx.yyy.zzz.www.sss" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" targetNamespace="http://xxx.yyy.zzz.www.sss" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
<b:schemaInfo standard="Flat File" root_reference="xxx_yyy" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="false" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" />
</xs:appinfo>
</xs:annotation>
<xs:element name="xxx_yyy">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="false" suppress_trailing_delimiters="true" sequence_number="1" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" notes="xxx_yyy" child_order="infix" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" maxOccurs="unbounded" name="FirstElement_AAA">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" preserve_delimiter_for_empty_data="false" suppress_trailing_delimiters="true" repeating_delimiter_type="hex" repeating_delimiter="0x0D 0x0A" tag_name="AAA," sequence_number="1" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" name="SecondElement_BBB">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="true" tag_name="BBB," />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<groupInfo sequence_number="0" />
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


Currently everything is working fine, except for when AAA, does not exist.










share|improve this question




















  • 2





    Set the <Schema> node property "Parser Optimization" to "Complexity"

    – José Amílcar Casimiro
    Jan 3 at 10:23






  • 1





    Thanks a lot, Please add it as an answer so i can mark it as an answer

    – Sufyan Jabr
    Jan 3 at 11:36


















1















Am building an XSD for a flat file, the XSD have two elements delimited by new line:




  • FirstElement_AAA: Repeating but optional with tag name (AAA,).

  • SecondElement_BBB: Single and Mandatory with tag name (BBB,).


So the XSD should support a flat file like:



AAA,
AAA,
BBB,


or



AAA,
BBB,


or



BBB,


The current XSD that i have:



<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://xxx.yyy.zzz.www.sss" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" targetNamespace="http://xxx.yyy.zzz.www.sss" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
<b:schemaInfo standard="Flat File" root_reference="xxx_yyy" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="false" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" />
</xs:appinfo>
</xs:annotation>
<xs:element name="xxx_yyy">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="false" suppress_trailing_delimiters="true" sequence_number="1" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" notes="xxx_yyy" child_order="infix" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" maxOccurs="unbounded" name="FirstElement_AAA">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" preserve_delimiter_for_empty_data="false" suppress_trailing_delimiters="true" repeating_delimiter_type="hex" repeating_delimiter="0x0D 0x0A" tag_name="AAA," sequence_number="1" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" name="SecondElement_BBB">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="true" tag_name="BBB," />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<groupInfo sequence_number="0" />
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


Currently everything is working fine, except for when AAA, does not exist.










share|improve this question




















  • 2





    Set the <Schema> node property "Parser Optimization" to "Complexity"

    – José Amílcar Casimiro
    Jan 3 at 10:23






  • 1





    Thanks a lot, Please add it as an answer so i can mark it as an answer

    – Sufyan Jabr
    Jan 3 at 11:36
















1












1








1


0






Am building an XSD for a flat file, the XSD have two elements delimited by new line:




  • FirstElement_AAA: Repeating but optional with tag name (AAA,).

  • SecondElement_BBB: Single and Mandatory with tag name (BBB,).


So the XSD should support a flat file like:



AAA,
AAA,
BBB,


or



AAA,
BBB,


or



BBB,


The current XSD that i have:



<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://xxx.yyy.zzz.www.sss" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" targetNamespace="http://xxx.yyy.zzz.www.sss" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
<b:schemaInfo standard="Flat File" root_reference="xxx_yyy" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="false" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" />
</xs:appinfo>
</xs:annotation>
<xs:element name="xxx_yyy">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="false" suppress_trailing_delimiters="true" sequence_number="1" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" notes="xxx_yyy" child_order="infix" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" maxOccurs="unbounded" name="FirstElement_AAA">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" preserve_delimiter_for_empty_data="false" suppress_trailing_delimiters="true" repeating_delimiter_type="hex" repeating_delimiter="0x0D 0x0A" tag_name="AAA," sequence_number="1" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" name="SecondElement_BBB">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="true" tag_name="BBB," />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<groupInfo sequence_number="0" />
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


Currently everything is working fine, except for when AAA, does not exist.










share|improve this question
















Am building an XSD for a flat file, the XSD have two elements delimited by new line:




  • FirstElement_AAA: Repeating but optional with tag name (AAA,).

  • SecondElement_BBB: Single and Mandatory with tag name (BBB,).


So the XSD should support a flat file like:



AAA,
AAA,
BBB,


or



AAA,
BBB,


or



BBB,


The current XSD that i have:



<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://xxx.yyy.zzz.www.sss" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" targetNamespace="http://xxx.yyy.zzz.www.sss" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
<b:schemaInfo standard="Flat File" root_reference="xxx_yyy" default_pad_char=" " pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="false" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" />
</xs:appinfo>
</xs:annotation>
<xs:element name="xxx_yyy">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="false" suppress_trailing_delimiters="true" sequence_number="1" child_delimiter_type="hex" child_delimiter="0x0D 0x0A" notes="xxx_yyy" child_order="infix" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element minOccurs="0" maxOccurs="unbounded" name="FirstElement_AAA">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" preserve_delimiter_for_empty_data="false" suppress_trailing_delimiters="true" repeating_delimiter_type="hex" repeating_delimiter="0x0D 0x0A" tag_name="AAA," sequence_number="1" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" name="SecondElement_BBB">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" sequence_number="2" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="true" tag_name="BBB," />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<groupInfo sequence_number="0" />
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


Currently everything is working fine, except for when AAA, does not exist.







xsd biztalk flat-file






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 9:35







Sufyan Jabr

















asked Jan 3 at 7:54









Sufyan JabrSufyan Jabr

591213




591213








  • 2





    Set the <Schema> node property "Parser Optimization" to "Complexity"

    – José Amílcar Casimiro
    Jan 3 at 10:23






  • 1





    Thanks a lot, Please add it as an answer so i can mark it as an answer

    – Sufyan Jabr
    Jan 3 at 11:36
















  • 2





    Set the <Schema> node property "Parser Optimization" to "Complexity"

    – José Amílcar Casimiro
    Jan 3 at 10:23






  • 1





    Thanks a lot, Please add it as an answer so i can mark it as an answer

    – Sufyan Jabr
    Jan 3 at 11:36










2




2





Set the <Schema> node property "Parser Optimization" to "Complexity"

– José Amílcar Casimiro
Jan 3 at 10:23





Set the <Schema> node property "Parser Optimization" to "Complexity"

– José Amílcar Casimiro
Jan 3 at 10:23




1




1





Thanks a lot, Please add it as an answer so i can mark it as an answer

– Sufyan Jabr
Jan 3 at 11:36







Thanks a lot, Please add it as an answer so i can mark it as an answer

– Sufyan Jabr
Jan 3 at 11:36














1 Answer
1






active

oldest

votes


















1














Set the node property "Parser Optimization" to "Complexity"






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54018342%2fxsd-optional-element-with-tag-name%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Set the node property "Parser Optimization" to "Complexity"






    share|improve this answer




























      1














      Set the node property "Parser Optimization" to "Complexity"






      share|improve this answer


























        1












        1








        1







        Set the node property "Parser Optimization" to "Complexity"






        share|improve this answer













        Set the node property "Parser Optimization" to "Complexity"







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 4 at 13:50









        José Amílcar CasimiroJosé Amílcar Casimiro

        1915




        1915
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54018342%2fxsd-optional-element-with-tag-name%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas