Solving development problems  |  About this blog

Archive for the ‘microsoft excel 2007 tooltips’ tag

Export from Excel 2007 to XML Data

Quick olnine tool to create simple HTML table from Excel worksheet is here: http://tableizer.journalistopia.com/

Export XML data in mapped cells to an XML data file

  • If the Developer tab is not available, do the following to display it:
    • Click the Microsoft Office Button Button image, and then click Excel Options.
  • In the Popular category, under Top options for working with Excel, select the Show Developer tab in the Ribbon check box, and then click OK.
    Note
    The Ribbon is a component of the Microsoft Office Fluent user interface.
  • On the Developer tab, in the XML group, click Export.

XML group in Ribbon

Note If a small Export XML dialog box appears, click the XML map that you want to use, and then click OK.

The Export XML dialog box will only appear if an XML table is not selected and if the workbook contains more than one XML map.

  • In the large Export XML dialog box, in the File name box, type a name for the XML data file.
  • Click Export.

Note There may be headings or labels in your worksheet that are different from the XML element names in the XML map. However, the XML element names are always used when you export or save XML data from the worksheet.

About creating XML Schema…

Here is a sample XML:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Root>

  <EmployeeInfo>
    <Name>Jane Winston</Name>
    <Date>2001-01-01</Date>
    <Code>0001</Code>
  </EmployeeInfo>

  <ExpenseItem>
    <Date>2001-01-01</Date>
    <Description>Airfare</Description>
    <Amount>500.34</Amount>
  </ExpenseItem>

  <ExpenseItem>
    <Date>2001-01-01</Date>
    <Description>Hotel</Description>
    <Amount>200</Amount>
  </ExpenseItem>

  <ExpenseItem>
    <Date>2001-01-01</Date>
    <Description>Taxi Fare</Description>
    <Amount>100.00</Amount>
  </ExpenseItem>

  <ExpenseItem>
    <Date>2001-01-01</Date>
    <Description>Long Distance Phone Charges</Description>
    <Amount>57.89</Amount>
  </ExpenseItem>

  <ExpenseItem>
    <Date>2001-01-01</Date>
    <Description>Food</Description>
    <Amount>82.19</Amount>
  </ExpenseItem>

  <ExpenseItem>
    <Date>2001-01-02</Date>
    <Description>Food</Description>
    <Amount>17.89</Amount>
  </ExpenseItem>

  <ExpenseItem>
    <Date>2001-01-02</Date>
    <Description>Personal Items</Description>
    <Amount>32.54</Amount>
  </ExpenseItem>

  <ExpenseItem>
    <Date>2001-01-03</Date>
    <Description>Taxi Fare</Description>
    <Amount>75.00</Amount>
  </ExpenseItem>

  <ExpenseItem>
    <Date>2001-01-03</Date>
    <Description>Food</Description>
    <Amount>36.45</Amount>
  </ExpenseItem>

  <ExpenseItem>
    <Date>2001-01-03</Date>
    <Description>New Suit</Description>
    <Amount>750.00</Amount>
  </ExpenseItem>

</Root>

And here is a sample schema:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="Root">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element minOccurs="0" maxOccurs="1" name="EmployeeInfo">
          <xsd:complexType>
            <xsd:all>
              <xsd:element minOccurs="0" maxOccurs="1" name="Name" />
              <xsd:element minOccurs="0" maxOccurs="1" name="Date" />
              <xsd:element minOccurs="0" maxOccurs="1" name="Code" />
            </xsd:all>
          </xsd:complexType>
        </xsd:element>
        <xsd:element minOccurs="0" maxOccurs="unbounded" name="ExpenseItem">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="Date" type="xsd:date"/>
              <xsd:element name="Description" type="xsd:string"/>
              <xsd:element name="Amount" type="xsd:decimal" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>