473,473 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

.net xml editor doesn't recognize extension correctly

I am trying to use the xml desinger in .net 1.1 to create
the follow schema. where USAddress is derived from Address
But when I generate the xml file, the .net xml editor says

"The active schema does not support the element 'street'"

The schema is from a msdn .net example.
What I am missing here?

Thanks
John

Here are the xml file and xsd file:

Here is the xml file:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="MySchema"
targetNamespace="http://tempuri.org/MySchema.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/MySchema.xsd"
xmlns:mstns="http://tempuri.org/MySchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="address">
<xs:sequence>
<xs:element name="street"
type="xs:string" />
<xs:element name="city"
type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="USAddress">
<xs:complexContent>
<xs:extension base="address">
<xs:sequence>
<xs:element
name="state" type="xs:string" />
</xs:sequence>
<xs:attribute
name="country" type="xs:string" fixed="US" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="USA"
type="USAddress"></xs:element>
</xs:schema>
Here is a schema saved as MySchema.xsd

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="MySchema"
targetNamespace="http://tempuri.org/MySchema.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/MySchema.xsd"
xmlns:mstns="http://tempuri.org/MySchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="address">
<xs:sequence>
<xs:element name="street"
type="xs:string" />
<xs:element name="city"
type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="USAddress">
<xs:complexContent>
<xs:extension base="address">
<xs:sequence>
<xs:element
name="state" type="xs:string" />
</xs:sequence>
<xs:attribute
name="country" type="xs:string" fixed="US" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="USA"
type="USAddress"></xs:element>
</xs:schema>
Nov 12 '05 #1
4 1488
John wrote:
I am trying to use the xml desinger in .net 1.1 to create
the follow schema. where USAddress is derived from Address
But when I generate the xml file, the .net xml editor says

"The active schema does not support the element 'street'"


You forgot to post your XML instance.
--
Oleg Tkachenko
XML Insider
http://www.tkachenko.com/blog
Nov 12 '05 #2
Here are xml instance file and schema:

xml:
<?xml version="1.0" encoding="utf-8" ?>
<USA xmlns="http://tempuri.org/MySchema.xsd">
<street> 1st </street>
<state > CA </state>
</USA>

Schema:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="MySchema"
targetNamespace="http://tempuri.org/MySchema.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/MySchema.xsd"
xmlns:mstns="http://tempuri.org/MySchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="usaddress">
<xs:complexContent>
<xs:extension base="address">
<xs:sequence>
<xs:element
name="state" type="xs:string" />
</xs:sequence>
<xs:attribute
name="country" type="xs:string" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="address">
<xs:sequence>
<xs:element name="street"
type="xs:string" />
<xs:element name="city"
type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="USA"
type="usaddress"></xs:element>
</xs:schema>

-----Original Message-----
John wrote:
I am trying to use the xml desinger in .net 1.1 to create the follow schema. where USAddress is derived from Address But when I generate the xml file, the .net xml editor says
"The active schema does not support the
element 'street'"
You forgot to post your XML instance.
--
Oleg Tkachenko
XML Insider
http://www.tkachenko.com/blog
.

Nov 12 '05 #3
Hi John,

I test the schema and XML file in my project it work well. ( I just copy
the xml code from your meassge to my VS.) Is the error only with the C++
project you upload?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 12 '05 #4

MSFT wrote:
*I test the schema and XML file in my project it work well. ( I just
copy
the xml code from your meassge to my VS.) Is the error only with the
C++
project you upload?

Luke
*


Luke what am I doing doing wrong? I got the same error as John. I did
the following:
1) Add a new schema to my project.
2) Paste John's schema example into the file.
3) Add a new XML file to the project
4) Right-click properties in the XML document to set the target schema
to the new schema.
5) Add street and state elements to the XML file.

The element street is underlined with a red wavy line with the tooltip
error "The active schema does not support the element 'street'."
I am using VS (version 7.1.3088) with .Net Framework (version 1.1.4322
SP1)

John's example was stright out of the .Net Framework general
regerence.
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpgenref/html/xsdrefextensioncomplexcontentelement.htm

--
kjm87
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message185473.html

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

71
by: tomy_baseo | last post by:
I'm new to HTML and want to learn the basics by learning to code by hand (with the assistance of an HTML editor to eliminate repetitive tasks). Can anyone recommend a good, basic HTML editor that's...
4
by: gswitz | last post by:
When Editing .SQL files using .Net, when I execute the SQL or Check the SQL, it reformats the SQL differently than we normally do it. I would like to know how I can disable this automatic...
8
by: pacs34 | last post by:
I just read some stuff about XHTML 2.0 and it sounds fascinating so I have been trying to create a small test doc which has a few graphics files but whenever I submit it to the W3 validator I get...
149
by: Christopher Benson-Manica | last post by:
(Followups set to comp.std.c. Apologies if the crosspost is unwelcome.) strchr() is to strrchr() as strstr() is to strrstr(), but strrstr() isn't part of the standard. Why not? --...
6
by: Bob | last post by:
I noticed that some of the Microsoft site pages have the extension name of mspx. It's easy to config IIS to map a particular extension name to the ASP.NET dll for production purpose. However I...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
3
by: naveen.sabapathy | last post by:
Hi, I am trying to use virtual serial ports to develop/test my serial communication program. Running in to trouble... I am using com0com to create the virtual ports. The virtual ports seem to...
3
by: lenbell | last post by:
When I create a html using my html editor and then insert php code I get odd results. I've gotten rid of most but some remain. If I rename the file to a .php it helps but still screws up. here...
19
by: Eric S. Johansson | last post by:
Almar Klein wrote: there's nothing like self interest to drive one's initiative. :-) 14 years with speech recognition and counting. I'm so looking to my 15th anniversary of being injured next...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.