Solved

XML Schema (XSD File)

Posted on 2009-07-08
5
401 Views
Last Modified: 2012-05-07
I am writing my first XSD schema file for validating incoming orders for product and/or literature.  My error seems to be related to identifying a sub-grouping of order items - I want one sub-group for Products and one sub-group for Collateral (literature).  I thought I was following an example but somewhere I'm not referencing the ComplexType ("t:ProductDetails" and "t:CollateralDetails").  Can anyone see what I'm doing incorrectly?  The error I'm receiving first is:
"t:ProductDetails" must refer to an existing simple or complex type.

The XSD file is attached.  
0
Comment
Question by:VDanner
  • 3
  • 2
5 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24806858
maybe you should attach the schema

- you might not have defined the simple or complex types as named types on a global level
- or there might be a namespace issue in that the "t:" prefixed namespace is not the default one
0
 

Author Comment

by:VDanner
ID: 24806869
I didn't realize I could not add files of extension "xsd".  Attached is the xsd file in Textpad format.
LSOrderSchema.txt
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 24806908
namespace issue.
t:OrderDetails is in the sqlserver namespace.
So, you will have to import that schema to make th efull schema valid
0
 

Author Comment

by:VDanner
ID: 24807001
Thanks, I don't think I fully understand the whole namespace issue as yet, as I wanted all this to be a single schema.  
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24807106
well, the question is then, do you really need OrderDetails to be of this type
simply make it
<xs:element name="OrderDetails" type="xs:string"/>
or if it is a complex type, copy the definition of that complex type in your own schema
and use it like this
<xs:element name="OrderDetails" type="OrderDetails"/>
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…

830 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