none
How to create a CSV/ excel Schema for XML RRS feed

  • Question

  • Hi team. i'm very new to xml/ related xml development And i Have Requirement, create a CSV / Excel (FlatfileSchema) Schema to convert CSV / Excel to xml, Can you please  advise and support to  create a CSV / Excel to create xml. 

    Sunday, June 23, 2019 3:30 AM

All replies

  • Hi Maheshma,

    Here is a step-by-step example for you:

    Excel to XML: How to Transfer Your Spreadsheet Data Onto an XML File

    Sunday, June 23, 2019 4:31 PM
  • HI Yitzhak,

    Thank your for your response, yes using abouve your instruction can be create a schema one excel table, but i want to create a schema as a below, my purpose is builded schema upload to Azure logic app integration account.Can you please advise on this.

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns="http://Integration1.PersonXml" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://Integration1.PersonXml" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Person">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Name">
    <xs:complexType>
    <xs:attribute name="FirstName" type="xs:string" />
    <xs:attribute name="MiddleName" type="xs:string" />
    <xs:attribute name="Surname" type="xs:string" />
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>

    Monday, June 24, 2019 12:31 AM
  • Hi Maheshma,

    Based on your clarifications, it is not related to Excel at all.

    If you need to create an XSD schema for some XML, please share sample of your XML.

    I will reply with the XSD schema for it.

    Monday, June 24, 2019 1:04 AM
  • Hi Yitzhak,

    ok but my requirement is Excel/csv file for create a schema to create a xml.

    Thanks

    Mahehs

    Monday, June 24, 2019 3:55 AM
  • Hi Maheshma,

    In such case, please share a screen shot of your Excel file.

    Monday, June 24, 2019 4:09 AM
  • Hi Yitzhak,

    Please find the bwlow attached sample screen shot.

    Sample- PersonCSv.xsd

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns="http://Integration1.Person" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://Integration1.Person" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:annotation>
        <xs:appinfo>
          <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.Azure.Integration.DesignTools.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
          <b:schemaInfo standard="Flat File" codepage="20127" 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="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" root_reference="Company" />
        </xs:appinfo>
      </xs:annotation>
      <xs:element name="Company">
        <xs:annotation>
          <xs:appinfo>
            <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
          </xs:appinfo>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:annotation>
              <xs:appinfo>
                <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
              </xs:appinfo>
            </xs:annotation>
            <xs:element maxOccurs="unbounded" name="Employee">
              <xs:annotation>
                <xs:appinfo>
                  <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                </xs:appinfo>
              </xs:annotation>
              <xs:complexType>
                <xs:sequence>
                  <xs:annotation>
                    <xs:appinfo>
                      <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                    </xs:appinfo>
                  </xs:annotation>
                  <xs:element name="FirstName" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="1" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="MiddleName" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="2" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="LastName" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="3" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

    Personxml.xsd

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns="http://Integration1.PersonXml" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://Integration1.PersonXml" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="Person">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Name">
              <xs:complexType>
                <xs:attribute name="FirstName" type="xs:string" />
                <xs:attribute name="MiddleName" type="xs:string" />
                <xs:attribute name="Surname" type="xs:string" />
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

    Thanks

    Mahesh

    Monday, June 24, 2019 4:58 AM
  • Hi Maheshma,

    I am confused. As I see, even BizTalk is involved.

    Let's start from the very beginning.

    Please explain in details the following:

    1. Your starting point.
    2. What needs to be done.
    3. End result that you are looking for.
    Monday, June 24, 2019 12:20 PM
  • HI Yitzhak,

     Sorry for the inconvenience caused, Please ignore BizTalk thing because i got this sample form internet.

    1. I have a requirement to create a csv/excel schema ageist the sample excel template. (If you require i can provide sample excel template)

    2, then base on the that excel/csv schema create a xml file.

    3.This is a sample i'm expecting, This sample got from internet.

    Sample- PersonCSv.xsd

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns="http://Integration1.Person" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://Integration1.Person" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:annotation>
        <xs:appinfo>
          <schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.Azure.Integration.DesignTools.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
          <b:schemaInfo standard="Flat File" codepage="20127" 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="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" root_reference="Company" />
        </xs:appinfo>
      </xs:annotation>
      <xs:element name="Company">
        <xs:annotation>
          <xs:appinfo>
            <b:recordInfo structure="delimited" child_delimiter_type="hex" child_delimiter="0xD 0xA" child_order="postfix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
          </xs:appinfo>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:annotation>
              <xs:appinfo>
                <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
              </xs:appinfo>
            </xs:annotation>
            <xs:element maxOccurs="unbounded" name="Employee">
              <xs:annotation>
                <xs:appinfo>
                  <b:recordInfo structure="delimited" child_delimiter_type="char" child_delimiter="," child_order="infix" sequence_number="1" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" />
                </xs:appinfo>
              </xs:annotation>
              <xs:complexType>
                <xs:sequence>
                  <xs:annotation>
                    <xs:appinfo>
                      <groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003" />
                    </xs:appinfo>
                  </xs:annotation>
                  <xs:element name="FirstName" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="1" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="MiddleName" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="2" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                  <xs:element name="LastName" type="xs:string">
                    <xs:annotation>
                      <xs:appinfo>
                        <b:fieldInfo justification="left" sequence_number="3" />
                      </xs:appinfo>
                    </xs:annotation>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

    Thanks

    Mahesh

    Monday, June 24, 2019 1:14 PM
  • Hi Maheshma,

    I will try to make an educated guess and answer my questions instead of you.

    1. Your starting point.
      Excel file. Please provide a screen shot of it.
    2. What needs to be done.
      Create XSD schema to export Excel file as XML file.
      I will create it for you.
    3. End result that you are looking for.
      XML file exported from Excel. Please provide a sample of it.


    Monday, June 24, 2019 5:03 PM