Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old December 14th, 2004, 04:16 PM
Authorized User
Join Date: Jun 2004
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default .NET and XML Namespaces - NamespaceManager


I was wondering if there is a way to populate the NameSpaceManager with multiple [prefix, URI] sets instead of doing NameSpaceManager.AddNameSpace for each set.

That is, say I have a string

XMLNS = "abc='www.abc.com' nop='www.nop.com' xyz='www.xyz.com'"

I want to do something like:

xmlnsManager = new NameSpaceManager(XMLNS);

instead of:

xmlnsManager.AddNamespace("abc", "www.abc.com")
xmlnsManager.AddNamespace("nop", "www.nop.com")
xmlnsManager.AddNamespace("xyz", "xyz.abc.com")

Is this possible?



Reply With Quote
  #2 (permalink)  
Old December 15th, 2004, 07:51 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

Not that I know of, it's not difficult to roll your own, split the string on the spaces and then split each item on the equals sign. You can then remove the single quotes in the URI.


Joe (Microsoft MVP - XML)
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cant reach data in xml with namespaces TPP XSLT 3 March 25th, 2006 03:40 PM
cant reach data in xml with namespaces TPP XSLT 1 March 24th, 2006 10:47 AM
Confused about XML namespaces planoie XSLT 2 June 2nd, 2005 04:23 AM
XML Namespaces billy_bob_the_3rd XML 1 January 31st, 2005 02:41 PM
Accessing XML Node with multiple namespaces bamirzada C# 0 August 14th, 2003 07:41 PM

All times are GMT -4. The time now is 11:38 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.