XmlDocument oXmlDoc = new XmlDocument();
oXmlDoc.Load(filename);
node = oXmlDoc.SelectSingleNode("//config/ldap/userpath");
Console.Write(node.InnerXml);
The value I get is:
\r\n\t\t\tOU=Walshy,OU=GroupServices,OU=organizati ons,OU=Portal,DC=portaladdev,DC=intranet,DC=local\ r\n\t\t
I know this is because of the format of the xml doc. The question is,
how do I get the value from the element without the escape characters?
Example of xml doc is as follows:
<?xml version="1.0" encoding="UTF-8" ?>
<config>
<ldap>
<userpath>
OU=Walshy,OU=GroupServices,OU=organizations,OU=Por tal,DC=portaladdev,DC=intranet,DC=local
</userpath>
</ldap>
</config>
Thanks. 1 3702
Ian Walsh <sp*******@tiscali.co.uk> wrote: XmlDocument oXmlDoc = new XmlDocument(); oXmlDoc.Load(filename); node = oXmlDoc.SelectSingleNode("//config/ldap/userpath"); Console.Write(node.InnerXml);
The value I get is:
\r\n\t\t\tOU=Walshy,OU=GroupServices,OU=organizati ons,OU=Portal,DC=po rtaladdev,DC=intranet,DC=local\r\n\t\t
My guess is that you're looking in the debugger.
I know this is because of the format of the xml doc. The question is, how do I get the value from the element without the escape characters?
The escape characters aren't actually there - the actual tabs, carriage
returns etc are there though. If you don't want them, use String.Trim.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: BTnews |
last post by:
Hi,
Can anyone here point me at a definitive guide or tutorial about using
escape characters when building SQL queries from user entered data?
I'm especially interested in info on this in regard...
|
by: Steve Litvack |
last post by:
Hello,
I have built an XMLDocument object instance and I get the following string
when I examine the InnerXml property:
<?xml version=\"1.0\"?><ROOT><UserData UserID=\"2282\"><Tag1...
|
by: teachtiro |
last post by:
Hi,
'C' says \ is the escape character to be used when characters are
to be interpreted in an uncommon sense, e.g. \t usage in printf(),
but for printing % through printf(), i have read that %%...
|
by: Steve Litvack |
last post by:
Hello,
I have built an XMLDocument object instance and I get the following string
when I examine the InnerXml property:
<?xml version=\"1.0\"?><ROOT><UserData UserID=\"2282\"><Tag1...
|
by: Guadala Harry |
last post by:
I'd like to know the answer to the following question so I can know what to
expect with regard to other similar uses of escape characters and strings.
While everything works fine - I'd like to know...
|
by: needin4mation |
last post by:
Hi,
string filename = "Directions2.xml";
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath("Directions2.xml"));
XmlElement root = doc.DocumentElement;
XmlNode oldLoc;
oldLoc =...
|
by: pkaeowic |
last post by:
I am having a problem with the "escape" character \e. This code is in my
Windows form KeyPress event. The compiler gives me "unrecognized escape
sequence" even though this is documented in MSDN....
|
by: Lawrence D'Oliveiro |
last post by:
The "escape" function in the "cgi" module escapes characters with special
meanings in HTML. The ones that need escaping are '<', '&' and '"'.
However, cgi.escape only escapes the quote character if...
|
by: Richard Lewis Haggard |
last post by:
Is it possible to use features from XmlDocument to unescape text back to its
original raw text format after it has been escaped to handle non-HTML
compliant character strings?
I have code that...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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...
| |