Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 14th, 2004, 05: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

Hi,

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?

Thanks,

Bobby

  #2 (permalink)  
Old December 15th, 2004, 08: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
Default

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)


Similar Threads
Thread Thread Starter Forum Replies Last Post
cant reach data in xml with namespaces TPP XSLT 3 March 25th, 2006 04:40 PM
cant reach data in xml with namespaces TPP XSLT 1 March 24th, 2006 11: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 03:41 PM
Accessing XML Node with multiple namespaces bamirzada C# 0 August 14th, 2003 07:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.