Solved

Importing XML into Excel 2007

Posted on 2009-04-13
10
1,023 Views
Last Modified: 2012-05-06
I'm trying to import an xml into excel 2007 but I am getting results where the xml is on more than one line.
Here is the schema:
  <?xml version="1.0" ?>
- <!--  edited with XML Spy v4.4 U (http://www.xmlspy.com) by Beccy Boyd (Telelogic Technologies UK Ltd)
  -->
- <xs:schema targetNamespace="http://www.DOORSTDIntegration.com/IntegrationDatasetConfiguration.xsd" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.DOORSTDIntegration.com/IntegrationDatasetConfiguration.xsd" xmlns:mstns="http://www.DOORSTDIntegration.com/IntegrationDatasetConfiguration.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" id="IntegrationDatasets">
- <xs:element name="IntegrationDatasets" msdata:IsDataSet="true" msdata:EnforceConstraints="False">
- <xs:complexType>
- <xs:choice>
  <xs:element name="DataFormatVersion" minOccurs="0" />
- <xs:element name="IntegrationDataset" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:sequence>
  <xs:element name="DOORSDatabaseId" type="xs:string" minOccurs="0" />
  <xs:element name="DOORSDatabaseName" type="xs:string" minOccurs="0" />
  <xs:element name="TDDatabaseName" type="xs:string" minOccurs="0" />
  <xs:element name="IntegrationDatasetId" type="xs:string" minOccurs="0" />
  <xs:element name="IntegrationDatasetName" type="xs:string" minOccurs="0" />
  <xs:element name="DOORSDatasetId" type="xs:string" minOccurs="0" />
  <xs:element name="TDDatasetId" type="xs:string" minOccurs="0" />
  <xs:element name="ControllingApp" type="xs:string" minOccurs="0" />
  <xs:element name="LastSynchronizedDate" type="xs:string" minOccurs="0" />
  <xs:element name="LastModifiedDate" type="xs:string" minOccurs="0" />
- <xs:element name="AttributeMapping" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:sequence>
  <xs:element name="DOORSAttrib" type="xs:string" minOccurs="0" />
  <xs:element name="TDAttrib" type="xs:string" minOccurs="0" />
  <xs:element name="Source" type="xs:string" minOccurs="0" />
  </xs:sequence>
  </xs:complexType>
  </xs:element>
- <xs:element name="SyncSchedule" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:sequence>
  <xs:element name="StartDate" type="xs:string" minOccurs="0" />
  <xs:element name="StartTime" type="xs:string" minOccurs="0" />
  <xs:element name="Frequency" type="xs:string" minOccurs="0" />
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  <xs:element name="DatasetVersion" type="xs:string" />
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  </xs:choice>
  </xs:complexType>
- <xs:key name="IntegrationDatasetsKey1" msdata:PrimaryKey="true">
  <xs:selector xpath=".//mstns:IntegrationDataset" />
  <xs:field xpath="mstns:IntegrationDatasetId" />
  </xs:key>
  </xs:element>
  </xs:schema>

After importing to excel each of the fields of the fields is created on a  new row.  I want it to be in the same row.
<xs:element name="DOORSDatabaseId" type="xs:string" minOccurs="0" />
  <xs:element name="DOORSDatabaseName" type="xs:string" minOccurs="0" />
  <xs:element name="TDDatabaseName" type="xs:string" minOccurs="0" />
  <xs:element name="IntegrationDatasetId" type="xs:string" minOccurs="0" />
  <xs:element name="IntegrationDatasetName" type="xs:string" minOccurs="0" />
  <xs:element name="DOORSDatasetId" type="xs:string" minOccurs="0" />
  <xs:element name="TDDatasetId" type="xs:string" minOccurs="0" />
  <xs:element name="ControllingApp" type="xs:string" minOccurs="0" />
  <xs:element name="LastSynchronizedDate" type="xs:string" minOccurs="0" />
  <xs:element name="LastModifiedDate" type="xs:string" minOccurs="0" />
- <xs:element name="AttributeMapping" minOccurs="0" maxOccurs="unbounded">

Here is a sample of the data:

  <?xml version="1.0" standalone="yes" ?> 

- <IntegrationDatasets xmlns="http://www.DOORSTDIntegration.com/IntegrationDatasetConfiguration.xsd">

  <DataFormatVersion>3</DataFormatVersion> 

- <IntegrationDataset>

  <DOORSDatabaseId>44d0d78c39e54b23</DOORSDatabaseId> 

  <DOORSDatabaseName>36681@ZCARH0WC</DOORSDatabaseName> 

  <TDDatabaseName>HTTP://QC9.CA.NORTEL.COM:8080/QCBIN</TDDatabaseName> 

  <IntegrationDatasetId>IDS_633138109903985683_3</IntegrationDatasetId> 

  <IntegrationDatasetName>Dilgeet_Int_ds</IntegrationDatasetName> 

  <DOORSDatasetId>DDS_633138101141834162_0</DOORSDatasetId> 

  <TDDatasetId>TDS_633138107782232903_2</TDDatasetId> 

  <ControllingApp>DOORS</ControllingApp> 

  <LastModifiedDate>11-05-2007 22:39:11</LastModifiedDate> 

  <DatasetVersion>2.1</DatasetVersion> 

- <LastSyncStatus>

  <DateAndTime>12-05-2007 22:08:36</DateAndTime> 

  <Status>Completed</Status> 

  <Duration>00:05:08</Duration> 

  </LastSyncStatus>

  <LastSynchronizedDate>12-05-2007 22:08:36</LastSynchronizedDate> 

- <AttributeMapping>

  <DOORSAttrib>Object Identifier</DOORSAttrib> 

  <TDAttrib>Object Identifier</TDAttrib> 

  <Source>DOORS</Source> 

  </AttributeMapping>

- <AttributeMapping>

  <DOORSAttrib>Nortel-Compliance</DOORSAttrib> 

  <TDAttrib>compliance</TDAttrib> 

  <Source>DOORS</Source> 

  </AttributeMapping>

- <AttributeMapping>

  <DOORSAttrib>Object Text</DOORSAttrib> 

  <TDAttrib>Description</TDAttrib> 

  <Source>DOORS</Source> 

  </AttributeMapping>

- <SyncSchedule>

  <StartDate>12-05-2007</StartDate> 

  <StartTime>22:03:00</StartTime> 

  <Frequency>Once Only</Frequency> 

  </SyncSchedule>

  </IntegrationDataset>

Open in new window

result-from-import.xlsx
0
Comment
Question by:cfehr-2
  • 4
  • 3
10 Comments
 

Author Comment

by:cfehr-2
ID: 24138354
Is there another way I can do this?
Basically what I have is two xmls that have a unique key between the two of them.
I want to merge those two xmls on that key.
I would prefer to put the result into a spreadsheet.
0
 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24174836
If you want to fine-tune the import, then this article may be for you. It explains how to programmatically import XML data in excel and transform it on the fly using XSLT to better suit the target: http://support.microsoft.com/kb/307021
0
 

Author Comment

by:cfehr-2
ID: 24306097
N/A
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 39

Expert Comment

by:abel
ID: 24306167
> No solution for 2007
I don't understand. What do you mean by that? Have you tried the link I showed you?

It is the custom at EE to not delete questions that have a discussion thread. If there's no solution, then that's the solution: no solution. But you didn't follow-up with additional comments for what you were after or why the info did not apply, so I have to object to the delete request.

See how to close questions for more info or ask here if anything is unclear.
0
 

Author Comment

by:cfehr-2
ID: 24306808
The solution proposed was for 2002/2003 and not excel 2007.
I no longer want to pursue this as I have started using swiftxml.
0
 
LVL 39

Expert Comment

by:abel
ID: 24311419
aha, I see. The solution worked for any office version, from 2002. But if you want to drop this, I consider it against EE policy: after all, even when you decide to drop it and take a different path, the question on itself is still valid and warrants an answer. Maybe not for you, but for the EE Archive this is important.
0
 
LVL 39

Expert Comment

by:abel
ID: 24347220
Please use #24174836 as answer. I was the only one to comment on this question and I haven't been given sufficient information why that comment would not be a viable answer.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now