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 | 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 11th, 2003, 09:52 AM
Authorized User
 
Join Date: Jun 2003
Location: Great Dunmow, Essex, United Kingdom.
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default namespace within namespace

HI All,

if my XML comprises:
<TalkMessage xmlns="http://www.xyz.co.uk/CM/envelope">
<Header>
........
</Header>
<Body>
<Notification xmlns="http://www.talk.co.uk/gateway/notification">
..............
</TalkMessage>

If I set :

objXMLDOM.setProperty "SelectionLanguage", "XPath"
objXMLDOM.setProperty "SelectionNamespaces", "xmlns:Talk='http://www.gtalk.co.uk/CM/envelope' xmlns:Talka='http://www.talk.co.uk/gateway/enrolmentnotification'"


where objXMLDOM is a DOMDOCUMENT

how do I make a reference to an element within the second namespace? and have I even declared the second correctly in the SetProperty above?


thanks

Reply With Quote
  #2 (permalink)  
Old December 11th, 2003, 10:59 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

You've done it right by assigning a made up prefix to match the default prefix in the source xml except that your namespace URIs don't exactly match the ones in setProperty, probably a typo. To select an element do:
Code:
Dim oNode
Set oNode = objXMLDOM.selectSingleNode("/Talk:TalkMessage/Talk:Body/Talka:Notification")
If Not oNode Is Nothing Then
 'Process
Else
 'Don't process
End If
Joe (MVP - xml)
assuming xml like:
Code:
<TalkMessage xmlns="http://www.xyz.co.uk/CM/envelope">
<Header>
Header stuff
</Header>
<Body>
<Notification xmlns="http://www.talk.co.uk/gateway/notification">
Notification data
</Notification>
</Body>
</TalkMessage>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Two namespace contain same name nir_pankaj C# 1 February 21st, 2007 12:30 PM
Namespace ~Bean~ Classic ASP Basics 2 June 3rd, 2005 02:31 PM
namespace Ibn_Aziz C# 2 December 25th, 2003 05:41 AM
Namespace flute Pro VB.NET 2002/2003 2 October 21st, 2003 09:15 AM



All times are GMT -4. The time now is 05:56 AM.


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