473,397 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Whitespace in app.config

Has anyone noticed that the xml in an app.config file is treated differently
than in a web.confg, or is it just me?

I have a component that parses and processes node fragments that are taken
from a .config file. When used in a .NET web app ( web.config ) the
component works fine. However, I found when using the identical node
fragment in a Windows app ( app.config ), I got an error. Basically, the
app.config xml had preserved all the whitespace nodes whereas the web.config
version had stripped them all out. Obviously, the solution is to change my
component so it can cope with either scenario, but I find it strange that
the xml is processed differently in each case.

Is this a feature others have come across, or have I done something idiotic?

Steve James
Nov 12 '05 #1
1 1499
"Steve James" <st***********@ntlworld.com> wrote in message news:<u4***************@newsfep1-gui.server.ntli.net>...
Has anyone noticed that the xml in an app.config file is treated differently
than in a web.confg, or is it just me?

I have a component that parses and processes node fragments that are taken
from a .config file. When used in a .NET web app ( web.config ) the
component works fine. However, I found when using the identical node
fragment in a Windows app ( app.config ), I got an error. Basically, the
app.config xml had preserved all the whitespace nodes whereas the web.config
version had stripped them all out. Obviously, the solution is to change my
component so it can cope with either scenario, but I find it strange that
the xml is processed differently in each case.

Is this a feature others have come across, or have I done something idiotic?

Steve James


I'm seeing the exact same behavior. If I run the same code in VS.Net
2002 with the 1.0 framework then there's no problem. However in
VS.NET 2003 in my configuration sections all of the whitespace is
preserved (in my case, \r\n\t...). ConfigurationSettings.AppSettings
still seems to work fine.
Nov 12 '05 #2

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

Similar topics

2
by: Wolfgang Jeltsch | last post by:
Hello, it is often convenient to insert whitespace into an XML document in order to format it nicely. For example, take this snippet of a notional DocBook XML document: <para> This is a...
2
by: Carlitos | last post by:
Hi there, A class in Xerces J-API (Java) called TextImpl contains a property that returns whether the text is ignorable whitespace...
2
by: Carlitos | last post by:
Hi there, A class in Xerces J-API (Java) called TextImpl contains a property that returns whether the text is ignorable whitespace...
0
by: Shan Plourde | last post by:
Hi everyone, I have been using various regular expressions with the ASP.NET RegularExpressionValidator for quite some time. In general it works very well. One of the common regex's that I use...
3
by: David Pratt | last post by:
Hi. I am splitting a string on a non whitespace character. One or more whitespace characters can be returned as items in the list. I do not want the items in the list that are only whitespace (can...
56
by: infidel | last post by:
Where are they-who-hate-us-for-our-whitespace? Are "they" really that stupid/petty? Are "they" really out there at all? "They" almost sound like a mythical caste of tasteless heathens that "we"...
9
by: amattie | last post by:
Does anyone have any idea on how I can strip the extra whitespace in the XML that shows up when I receive a response from an ASP.NET 2.0 webservice? This has been discussed before, but no one has...
0
by: pedjacar | last post by:
Hello, I have the following problem - when whitespace character (e.g %20) is added to the URL of a .jsp page, the Apache web server does not recognize that it is a URL pattern that is mounted to...
13
by: Chaim Krause | last post by:
I am unable to figure out why the first two statements work as I expect them to and the next two do not. Namely, the first two spit the sentence into its component words, while the latter two...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.