Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 7th, 2008, 07:46 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default Schema derived type and the base type

Hi,

I recently bought Word 2007 to try its XML support. When I try to import my schema I receive an error:

"Schema derived type and the base type must have the same content type"

Its pointing to a complexType element that is mixed:
Code:
<xs:complexType name="texttype" mixed="true">
        <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="bold" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="italic" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="UnderScore" minOccurs="0" maxOccurs="unbounded"/>


My Schema are valid, does anyone know why I am receiving the error?

 
Old January 8th, 2008, 05:01 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You might be trying to extend a mixes type with a none mixed type. What elements are you defining that extend "texttype". Try adding mixed="true" to them as well.

/- Sam Judson : Wrox Technical Editor -/
 
Old January 8th, 2008, 05:01 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Well, either the schema is valid, in which case Word 2007 is wrong, or its invalid, in which case you are wrong. Since you haven't said what makes you think it is valid, and since you haven't supplied enough of the schema for anyone else to come up with an opinion on the matter, the rest of us will have to keep an open mind.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old January 8th, 2008, 08:12 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Sam & Michael,

Thank you for your help. Sam was correct.

As for validation, I am using xmlSPY and it validated before I fixed the problem.

Thanks for the help.

Bones

 
Old January 8th, 2008, 08:44 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I hate to be blunt, but it is a common error to think that because XMLSpy accepts a schema, the schema is therefore valid. You should never accept a schema as valid until you've put it through two or three XML schema processors, one of which should be Xerces.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old January 8th, 2008, 09:04 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Hi Michael,

Blunt is good, you are correct. It is a good practice.

As always, thanks for your help.

Bones







Similar Threads
Thread Thread Starter Forum Replies Last Post
Guidelines Item 3: Replace System.Type with Type Ixtlia BOOK: Professional .NET 2.0 Generics 0 August 19th, 2007 04:09 AM
Conversion from type 'DBNull' to type 'String' is GailCG ASP.NET 2.0 Basics 5 February 22nd, 2007 03:12 PM
Convert "String" type to "Control" type ? kishore_peddi C# 4 January 11th, 2006 01:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.