Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / March 2006

Tip: Looking for answers? Try searching our database.

Web.config with multiple schemas

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sami Marzouki - 29 Mar 2006 14:13 GMT
Hi,
What I'm trying to do is:

    - To write a Web.config with custom sections. (Done)
    - To write a xsd schema for this custom sections.(Done)
    - Tell the Web.config to take the two schemas.

When i specify the two schemas in the schemas property of the
web.config, it seems that only one is token.

For now, what i found is to add a line in the DotnetConfig.xsd
<xs:include schemaLocation="MyCustomSchema.xsd" />

Aren't they anyway to not modify the DotnetConfig.xsd, but instead,
to modify the customschema??

Greetz,
Sami
Stan Kitsis [MSFT] - 29 Mar 2006 22:06 GMT
Hi Sami,

You need to declare a namespace in your "MyCustomSchema.xsd".  The XML
Editor does not support having two schemas with the same namespace listed in
the schemas property - in your case you have two schemas with no
targetNamespace.

Signature

Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> Hi,
> What I'm trying to do is:
[quoted text clipped - 14 lines]
> Greetz,
> Sami
Sami Marzouki - 30 Mar 2006 09:08 GMT
Hi Stan,
Thx for your answer:

So if i did wel understand you:
so must look like:

> <?xml version="1.0" encoding="utf-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified"
> attributeFormDefault="unqualified"
> targetNamespace="http://berco.com/webservices/WebConfig"
> xmlns="http://berco.com/webservices/WebConfig">

I have another question:

in my Web.config , i have put my custom sections into configuration
section like this:

Web.Config

> <?xml version="1.0"?>
> <!--
[quoted text clipped - 24 lines]
>         RemoteObject.ACO.WebEnabled="True"
>     />

But, the intellisense won't give my custom sections in configuration
section, i mean, that i must be out <configuration> section to see my
sections in intellisense.

> Hi Sami,
>
> You need to declare a namespace in your "MyCustomSchema.xsd".  The XML
> Editor does not support having two schemas with the same namespace listed in
> the schemas property - in your case you have two schemas with no
> targetNamespace.
Stan Kitsis [MSFT] - 30 Mar 2006 22:21 GMT
Hi Sami,

Once you've added a target namespace to your schema, you'll also need to
declare it in the instance document:

<configuration xmlns:myNS="http://berco.com/webservices/WebConfig">
</configuration>

When you do this, you'll get intellisense for your own namespace under
configuration section.  This complication is related to the fact that
configuration element has xs:any as a child.  This will be changed in the
next release so that you don't have to declare the namespace in your XML,
but for now you have to do it.
Signature

Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> Hi Stan,
> Thx for your answer:
[quoted text clipped - 60 lines]
>> in the schemas property - in your case you have two schemas with no
>> targetNamespace.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.