troubleshooting Question

XML Schema Same Name Element In Child and Parent

Avatar of TSQLGuy30
TSQLGuy30 asked on
Microsoft SQL Server 2008
2 Comments1 Solution2863 ViewsLast Modified:
Lets assume I have the following XML:


If I use the following schema document:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="">
  <xs:element name="People">
        <xs:element name="DateCreate" type="xs:dateTime" />

I'm getting an error when trying to load this in SSIS saying the following...

[XML Source [1]] Error: The component "XML Source" (1) was unable to process the XML data. The Xml source document contains multiple "DateCreate" elements and maxOccurs=1 was specified in the Xml schema.

I only want to pull in the DateCreate field in the People Node Level, Not in the Attribute Node level but it's trying to pull both in and says it can't do that.

Any Ideas on a fix?

Thanks All.
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros