Loading data from xml
I have an xml file I want to use as the source. It's not overly complicated, but not simple either. It has one hierachy, and one optional field and looks like this
a
1 'text'
2 'text'
b
1 'text'
2'text' 'optional field'
Ok, now I want the data to load like this:
a,1,text
a,2,text
b,1,text
b,2,text, optional field
but when I try to use the xml source it won't create the xsd...anything I can do?
September 17th, 2006 3:01pm
ps, oblviously the xml source file doesn't look EXACTLY like that, but I've cut out the tags etc...
Free Windows Admin Tool Kit Click here and download it now
September 17th, 2006 3:08pm
Hi,
Can you paste in the error message you are getting?
ThanksMark
September 19th, 2006 5:07am
The error message is:
Error at Data Flow Task [XML Source[1]]: The XML Source Adapter does not support mixed content model on Complex Types.
Free Windows Admin Tool Kit Click here and download it now
September 19th, 2006 11:47am
In your schema, do you have any complex types that have mixed="true" defined? SSIS does not support this. You would need to change your content model on complex types to notbe mixed, or preprocess the documents with an XSLT.
thanksmark
September 19th, 2006 9:11pm
The error message is at the point when I hit the button to create a schema. Up to that point I'm simply pointing at a fairly simple xml file (part of which I've copied below.
<?xml version="1.0" ?>
- <ADB ID="1">
<ITEM ID="1">1</ITEM>
<ITEM ID="2">Alfetta</ITEM>
<ITEM ID="3">1,6</ITEM>
<ITEM ID="29">2,8-3,4</ITEM>
- <ITEM ID="31">1-3-4-2 <GREF>75175</GREF></ITEM>
etc
I want the database records to be:
1,1,1
1,2,alfetta
1,2,1.6
1,29,2.8-3.4
1,31,1-3-4-2,75175
Free Windows Admin Tool Kit Click here and download it now
September 20th, 2006 4:10pm
For some reason this post is currupt below the xml.
The first column is missing it should read
etc
I want the database records to be:
1,1,1
1,2,alfretta
1,2,1.6
1,29,2.8-3.4
1,131,1-3-4-2,75175
September 20th, 2006 4:18pm
Just follow the Mark Durley's advice.
First, transform your original XML file into another well shaped XML file, consumable for SSIS, by using XSLT transformation.Second, loadwell shaped XML file into a destination database.
Regards,Yitzhak
Free Windows Admin Tool Kit Click here and download it now
September 20th, 2006 8:25pm
Hi Yitzhak,
Thanks.... I am facing the same issue
XSLT is some tool? how to use it to convert the existing xml to another xml?
REgards,
Eshwar
November 3rd, 2010 5:09am