473,782 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why must <configSections > be 1st element of <configuratio n> ?

Parser Error Message:
Only one <configSections > element allowed. It must be the first child
element of the root <configuratio n> element.

OK, fine, easy enough to fix, I just need to copy and paste this block to
where .NET wants it to be. But I can't help but think, why??? Doesn't this
insistense on ordinal placement run counter to the whole XML 'philosophy'? I
mean the node "/configuration/configSections" should be just as accessible
whether it is the first, last or in between other nodes, as long as it is a
direct child of "/configuration". So why this insistence that it be the
absolute first among its siblings?

- Joe Geretz -
Nov 19 '05 #1
2 4363

"Joseph Geretz" <jg*****@nospam .com> wrote in message
news:eu******** ******@TK2MSFTN GP14.phx.gbl...
Parser Error Message:
Only one <configSections > element allowed. It must be the first child
element of the root <configuratio n> element.

OK, fine, easy enough to fix, I just need to copy and paste this block to
where .NET wants it to be. But I can't help but think, why??? Doesn't this
insistense on ordinal placement run counter to the whole XML 'philosophy'?


No. An XML schema can be as tight or loose as you like, but like with all
type systems, tighter is better, within reason.

For instance his requirement guarantees that I can read a configSection with
streaming XML reader by hiting the first element node and then skipping
forward to the desired section. Without a guarantee about the ordering I
would have to load the whole XML document into a DOM and run an XPath query
just to find a single the configSections
David
Nov 19 '05 #2
Thanks for pointing that out David. You're absolutely correct.

- Joe Geretz -

"David Browne" <davidbaxterbro wne no potted me**@hotmail.co m> wrote in
message news:%2******** **********@TK2M SFTNGP15.phx.gb l...

"Joseph Geretz" <jg*****@nospam .com> wrote in message
news:eu******** ******@TK2MSFTN GP14.phx.gbl...
Parser Error Message:
Only one <configSections > element allowed. It must be the first child
element of the root <configuratio n> element.

OK, fine, easy enough to fix, I just need to copy and paste this block to
where .NET wants it to be. But I can't help but think, why??? Doesn't
this insistense on ordinal placement run counter to the whole XML
'philosophy'?


No. An XML schema can be as tight or loose as you like, but like with all
type systems, tighter is better, within reason.

For instance his requirement guarantees that I can read a configSection
with streaming XML reader by hiting the first element node and then
skipping forward to the desired section. Without a guarantee about the
ordering I would have to load the whole XML document into a DOM and run an
XPath query just to find a single the configSections
David

Nov 19 '05 #3

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

Similar topics

0
2177
by: Faisal | last post by:
I have a question regarding the "PublicKeyToken" attribute of the "<section>" tag in the web.config file. Pretty much most references have this value set to "b77a5c561934e089"; the same value as in the machine.config file <configSections <section name="sampleSection" type="System.Configuration.SingleTagSectionHandler, System,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" / </configSections My question is, does the...
0
1742
by: anonieko | last post by:
Add a reference to log4net.dll 1: In the APP.CONFIG write the following: <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="log4net" type="System.Configuration.IgnoreSectionHandler" /> </configSections>
1
2262
by: Joseph Geretz | last post by:
Why isn't the ASP.NET runtime providing a valid reference for this object to my WebService? I'm trying to use WSE and DIME to send attachments via Web Service. I've provided a whole lot of information in the thread below: DIME: Attachments.Add - Object reference not set to an instance of an object. Bu when all is said and done, the crux of the problem is that ResponseSoapContext.Current = <undefined value> when I attempt to access it....
2
2004
by: Joseph Geretz | last post by:
Parser Error Message: Only one <configSections> element allowed. It must be the first child element of the root <configuration> element. OK, fine, easy enough to fix, I just need to copy and paste this block to where .NET wants it to be. But I can't help but think, why??? Doesn't this insistense on ordinal placement run counter to the whole XML 'philosophy'? I mean the node "/configuration/configSections" should be just as accessible...
2
5155
by: Vikram | last post by:
I am using log4net in a vb.net console application. But its not working. I have added congif setting in app.config file also No error is generated but app. does not write to log file. app.config file: <?xml version="1.0" encoding="utf-8" ?>
5
8614
by: Rainer Queck | last post by:
Hello NG, Is it possible to share the settings of an application with a class libreary? In my case I have a application and a set of different reports (home made) put into a class library. The plan is to delivere different report.dlls with the main app. But it is essentially importent, that the reports and the app use the same settings.
9
2721
by: Milsnips | last post by:
Hi all. i'm tryng to implement the Rewrite.NET url rewritining functionality into a test project i've created, however i am hitting a problem at this line (direct from the web example): System.Collections.Specialized.NameValueCollection SectionIndex = (System.Collections.Specialized.NameValueCollection)System.Configuration.ConfigurationSettings.GetConfig("Rewrite.NET/Index"); The value always returns me null, and just to check it was...
7
6224
by: =?Utf-8?B?RXZl?= | last post by:
I have the following sections defined in my app.config file: <configSections> <section name="1" type="System.Configuration.DictionarySectionHandler" /> <section name="2" type="System.Configuration.DictionarySectionHandler" /> <section name="3" type="System.Configuration.DictionarySectionHandler" /> </configSections>
0
9641
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10313
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10080
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9944
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.