By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,871 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,871 IT Pros & Developers. It's quick & easy.

Why must <configSections> be 1st element of <configuration> ?

P: n/a
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
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
Share this Question
Share on Google+
2 Replies


P: n/a

"Joseph Geretz" <jg*****@nospam.com> wrote in message
news:eu**************@TK2MSFTNGP14.phx.gbl...
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'?


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

P: n/a
Thanks for pointing that out David. You're absolutely correct.

- Joe Geretz -

"David Browne" <davidbaxterbrowne no potted me**@hotmail.com> wrote in
message news:%2******************@TK2MSFTNGP15.phx.gbl...

"Joseph Geretz" <jg*****@nospam.com> wrote in message
news:eu**************@TK2MSFTNGP14.phx.gbl...
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'?


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 discussion thread is closed

Replies have been disabled for this discussion.