SelectSingleNode not working... Code provided.

All,

The xml file below is a response from a Live Meeting service.  I need to 
extract the following two fields: mid and audienceInviteText

I am using vbscript to try and retrieve these values but my code tells me 
the replynode is required at line 5.  Here is what I have:

set xmlbody = createobject("Msxml2.DOMDocument")
xmlbody.loadXML("c:\MeetingResponse.xml")

Set replynode = 
xmlbody.selectSingleNode("//CreateMeetingReply/MeetingReply/OptionList")
Set myAtt = replynode.getAttributes.GetNamedItem("mid")
msgbox myAtt.Value


' File name is C:\MeetingResponse.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PlaceWareConfCenter>
<CreateMeetingReply>
<MeetingReply>
<OptionList>
<StringOption value="49129v48zw3zw3dk" name="mid"></StringOption>
<StringOption value="Rafael has invited you to attend a Live Meeting.

https://www.livemeeting.com/cc/test/join?id=J6333&amp;role=attend&amp;pw=wn%3F%2447444

  Subject: Test Meeting
  Meeting URL: https://www.livemeeting.com/cc/test/join
  Meeting ID: J64443
  Meeting Key: wn?&amp;12345
  Role: Attendee
  Audio Conferencing (Toll-free): +1 (800) 123-0000
  Participant Code: 000000

FIRST TIME USERS: To save time before the meeting, check your system to make 
sure it is compatible with Microsoft Office Live Meeting: 
http://go.microsoft.com/fwlink/?linkid=53334

This Live Meeting invitation is a personal invitation; it should not be 
forwarded.

For assistance, visit Live Meeting Help and Support:
http://r.office.microsoft.com/r/rlidLiveMeeting?p1=7&amp;p2=en_US&amp;p3=LMInfo&amp;p4=support" 
name="audienceInviteText"></StringOption>
</OptionList>
</MeetingReply>
</CreateMeetingReply>
</PlaceWareConfCenter> 

0
rafael1119 (59)
9/25/2007 3:53:57 PM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
641 Views

Similar Articles

[PageSpeed] 17

Rafael wrote:

> The xml file below is a response from a Live Meeting service.  I need to 
> extract the following two fields: mid and audienceInviteText
> 
> I am using vbscript to try and retrieve these values but my code tells 
> me the replynode is required at line 5.  Here is what I have:
> 
> set xmlbody = createobject("Msxml2.DOMDocument")

This newsgroup is about XML and the .NET framework. If you use the .NET 
framework then you should not use MSXML but rather use the classes in 
System.Xml, like XmlReader or XPathDocument/XPathNavigator or XmlDocument.

> xmlbody.loadXML("c:\MeetingResponse.xml")

The loadXML method takes a string with XML, not a file name. Use the 
load method if you want to load from a URL or file e.g.
   If xmlbody.load("C:\MeetingResponse.xml") Then
     ' parse out values here
   Else
     ' deal with xmlbody.parseError here
   End If


> Set replynode = 
> xmlbody.selectSingleNode("//CreateMeetingReply/MeetingReply/OptionList")

Set
   xmlbody.setProperty "SelectionLanguage", "XPath"
firsdt with Msxml2.DOMDocument, then call selectSingleNode or 
selectNodes with an XPath expression.

> Set myAtt = replynode.getAttributes.GetNamedItem("mid")
> msgbox myAtt.Value
> 
> 
> ' File name is C:\MeetingResponse.xml
> 
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <PlaceWareConfCenter>
> <CreateMeetingReply>
> <MeetingReply>
> <OptionList>
> <StringOption value="49129v48zw3zw3dk" name="mid"></StringOption>
> <StringOption value="Rafael has invited you to attend a Live Meeting.
> 
> https://www.livemeeting.com/cc/test/join?id=J6333&amp;role=attend&amp;pw=wn%3F%2447444 
> 
> 
>  Subject: Test Meeting
>  Meeting URL: https://www.livemeeting.com/cc/test/join
>  Meeting ID: J64443
>  Meeting Key: wn?&amp;12345
>  Role: Attendee
>  Audio Conferencing (Toll-free): +1 (800) 123-0000
>  Participant Code: 000000
> 
> FIRST TIME USERS: To save time before the meeting, check your system to 
> make sure it is compatible with Microsoft Office Live Meeting: 
> http://go.microsoft.com/fwlink/?linkid=53334
> 
> This Live Meeting invitation is a personal invitation; it should not be 
> forwarded.
> 
> For assistance, visit Live Meeting Help and Support:
> http://r.office.microsoft.com/r/rlidLiveMeeting?p1=7&amp;p2=en_US&amp;p3=LMInfo&amp;p4=support" 
> name="audienceInviteText"></StringOption>

Use e.g.
   Set optionList = 
xmlbody.selectSingleNode("PlaceWareConfCenter/CreateMeetingReply/MeetingReply/OptionList")
   Set midValue = optionList.selectSingleNode("StringOption[@name = 
'mid']/@value")
   Set inviteValue = optionList.selectSingleNode("StringOption[@name = 
'audienceInviteText']/@value")
   ' now you can access midValue.value and inviteValue.value e.g.
   WScript.Echo midValue.value
   WScript.Echo inviteValue.value

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
9/25/2007 4:27:16 PM
Excellent Martin! Exactly what I was looking for.

Thanks,

Rafael

"Martin Honnen" <mahotrash@yahoo.de> wrote in message 
news:emWK7D5$HHA.5160@TK2MSFTNGP05.phx.gbl...
> Rafael wrote:
>
>> The xml file below is a response from a Live Meeting service.  I need to 
>> extract the following two fields: mid and audienceInviteText
>>
>> I am using vbscript to try and retrieve these values but my code tells me 
>> the replynode is required at line 5.  Here is what I have:
>>
>> set xmlbody = createobject("Msxml2.DOMDocument")
>
> This newsgroup is about XML and the .NET framework. If you use the .NET 
> framework then you should not use MSXML but rather use the classes in 
> System.Xml, like XmlReader or XPathDocument/XPathNavigator or XmlDocument.
>
>> xmlbody.loadXML("c:\MeetingResponse.xml")
>
> The loadXML method takes a string with XML, not a file name. Use the load 
> method if you want to load from a URL or file e.g.
>   If xmlbody.load("C:\MeetingResponse.xml") Then
>     ' parse out values here
>   Else
>     ' deal with xmlbody.parseError here
>   End If
>
>
>> Set replynode = 
>> xmlbody.selectSingleNode("//CreateMeetingReply/MeetingReply/OptionList")
>
> Set
>   xmlbody.setProperty "SelectionLanguage", "XPath"
> firsdt with Msxml2.DOMDocument, then call selectSingleNode or selectNodes 
> with an XPath expression.
>
>> Set myAtt = replynode.getAttributes.GetNamedItem("mid")
>> msgbox myAtt.Value
>>
>>
>> ' File name is C:\MeetingResponse.xml
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>> <PlaceWareConfCenter>
>> <CreateMeetingReply>
>> <MeetingReply>
>> <OptionList>
>> <StringOption value="49129v48zw3zw3dk" name="mid"></StringOption>
>> <StringOption value="Rafael has invited you to attend a Live Meeting.
>>
>> https://www.livemeeting.com/cc/test/join?id=J6333&amp;role=attend&amp;pw=wn%3F%2447444 
>> Subject: Test Meeting
>>  Meeting URL: https://www.livemeeting.com/cc/test/join
>>  Meeting ID: J64443
>>  Meeting Key: wn?&amp;12345
>>  Role: Attendee
>>  Audio Conferencing (Toll-free): +1 (800) 123-0000
>>  Participant Code: 000000
>>
>> FIRST TIME USERS: To save time before the meeting, check your system to 
>> make sure it is compatible with Microsoft Office Live Meeting: 
>> http://go.microsoft.com/fwlink/?linkid=53334
>>
>> This Live Meeting invitation is a personal invitation; it should not be 
>> forwarded.
>>
>> For assistance, visit Live Meeting Help and Support:
>> http://r.office.microsoft.com/r/rlidLiveMeeting?p1=7&amp;p2=en_US&amp;p3=LMInfo&amp;p4=support" 
>> name="audienceInviteText"></StringOption>
>
> Use e.g.
>   Set optionList = 
> xmlbody.selectSingleNode("PlaceWareConfCenter/CreateMeetingReply/MeetingReply/OptionList")
>   Set midValue = optionList.selectSingleNode("StringOption[@name = 
> 'mid']/@value")
>   Set inviteValue = optionList.selectSingleNode("StringOption[@name = 
> 'audienceInviteText']/@value")
>   ' now you can access midValue.value and inviteValue.value e.g.
>   WScript.Echo midValue.value
>   WScript.Echo inviteValue.value
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 

0
rafael1119 (59)
9/25/2007 5:32:55 PM
Reply:

Similar Artilces:

Why Justified format does not work in my outgoing emails?
Why Justified format does not work in my outgoing emails? I works in my English version. I did see a report from someone using another language (I think it was German), where that version put in the wrong HTML Align tag. Are you using a version other than English? -- Mike - http://TechHelp.Santovec.us "Sateesh Rajhans" <SateeshRajhans@discussions.microsoft.com> wrote in message news:6771553E-2561-4784-81C8-60F0723582C4@microsoft.com... > Why Justified format does not work in my outgoing emails? ...

Paused Items in Work Flow Monitor
In MSCRM 3.0, I see lot of paused email items older than 90 days. By CANCELLING the items, will I be deleting the actual copy of the email from CRM ? I am assuming paused means the email never left outbox or reached inbox. Please advise setting the status to cancel will not delete the e-mail from the database. "shoregoogly" wrote: > In MSCRM 3.0, I see lot of paused email items older than 90 days. > By CANCELLING the items, will I be deleting the actual copy of the > email from CRM ? > > I am assuming paused means the email never left outbox or reached > inbox...

Copying part of a work sheet.
I am probably missing something but I have a long 'list' in a work sheet. I want to copy it to another worksheet. More importatly I want tp present it on my web-site but have yet to find a way of copying only the rows I want on the site, not the other 400 rows underneath, rather like selecting what you want to print . ...

ddl not working in scrip
Hi, I have some script where i create a temp table in sql 2k5 such as create table #tmp ( usrlogin varchar(10) ) I then insert data into this temp table and run an alternate query that deletes some of the rows... Next i add an identity column so i can use it for a while loop as opposed to a cursor. alter table #tmp add row_id int identity(1,1) The problem is it doesnt execute the ddl statement above in my script. I know that sql server determines a query execution plan and might run some things out of order. I tried separating with the go statement and even creat...

email forwarding does not work
http://www.msexchange.org/tutorials/MF015.html i followed this article! why the email forwarding does not work for me?! the message i try to send to internal recipient remain in smtp queue (until expires), does not arrive to extenal recipient, why, why?!?! MMC wrote: > http://www.msexchange.org/tutorials/MF015.html > i followed this article! > why the email forwarding does not work for me?! > the message i try to send to internal recipient remain in smtp queue (until > expires), does not arrive to extenal recipient, why, why?!?! > > > > Can you send an Email...

vbTab or Chr(9) not working
Im trying to use the vbTab or Chr(9) in order to get a tabulator character. The result is always a single space instead of a tab. Any ideas why? ="test1" &vbCrLf & "test2" results in "test1 test2" is the tab character not supported??? Thanks for any help ...

Working with dates
I have a list of dates in the format dd/mm/yyyy and I want to count the number of dates older than 7 days. I'm trying to use the "countif" function =countif(F7:F80"<today()-7") and if that worked I wouldn't be asking for help. No matter what combinations I try, it always gives a value of zero. I thought that Excel stored dates in the format of a number starting at 1 jan 1900 so I can't see why it won't work. If I take out the minus 7 it still gives a result of zero. Hi Ken! Try: =COUNTIF(F7:F80,">"&TODAY()-7) -- Regards Norman Harker...

State field not working in Mail Merge
I tried doing a mail merge for labels from a list of accounts; however the State/Province field will not display. Has anyone else run into this or have a solution? Thanks. ...

Not working...
I tried to do it, but it is still not working. But, I noticed something strange today. If I open my application, then I move to another application, or minimize it - and when I retore my application, it looks fine!! I don't know what is going on... Any help will be appreciate!! Judith Just a thought... If you explained what the problem was, you would probably have a much better chance of getting someone who could figure out why it is happening. I don't know if you've already discussed it in a thread somewhere but this post was not connected with any previous posts. -- Jona...

Outside Meeting Appointments no longer working
Hello, After I applied Service Pack 2 for Exchange server, our company is no longer able to receive outside meeting requests. Is there a check box somewhere that was checked/unchecked to not allow this type of meeting request to be allowed either through Outlook or Exchange? If so I can not find the setting...Please advise. --> Our internal meeting requests still work without any problems. --> When we get an outside meeting request notification they now look like this: From: jane smith [mailto:jane smith@company.com] Sent: Wednesday, February 13, 2006 9:14 AM To: individual1; i...

Macro referencing data validation doesn't work
Version: 2004 Operating System: Mac OS X 10.4 (Tiger) Processor: Intel Hi - New to VBA &amp; the forum. <br><br>When I create a macro that references a data validation cell, the code does not acknowledge the value selected from the pull down menu. But, if the value is manually typed into the data validation cell, the code works fine. Any ideas? I've had PC users try the code with no problems. <br><br>I'm using the following code: <br> [Code]Private Sub Worksheet_Change(ByVal Target As Range) <br> If Not Intersect(Target, Range(&qu...

Advanced Go To Not Working
I tried to add an advanced GO To as myself (a power user) and I got the following message: [Microsoft][ODBC SQL Server Driver][SQL Server]The EXECUTE permission was denied on the object 'zDP_GOTO100SS_1', database 'DYNAMICS', schema 'dbo'. I went in as sa and added the go to and all worked fine, it even worked! Now when I try to run the go to on the smartlist it gives me the same error. I then proceeded to the following steps (which were suggested by a previous post) and no luck, still same error message. 1 Log in as sa or dynsa 2 Go to File | Mainte...

pdf reader not working anymore while previewing e-mail
For whatever reason, why I preview an e-mail, I can preview a pix, a doc, but not a pdf file anymore...what happened? What can I do to fix this problem? thank you, Joel gjoelfranco@gmail.com ...

Sign Out Not Working
Sign Out – I use Vista Home Premium. When I click on the Sign Out option, it does not sign me off. What should I do? And, my cookies are on. Jerry Jerry, What are you signed on to that you can't sign off from ? An application ? The computer ? Do you mean Log On and Log Off ? Also, why do you mention that your "cookies are on" ? What leads you to believe this has anything to do with your problem ? BB "Jerry" <Jerry@discussions.microsoft.com> wrote in message news:7A4FF2A7-F7BC-4443-9EC7-583CC37D1F04@microsoft.com... > Sign Ou...

Option group not working
I have a form that I have created an Option group for.There are 8 choices within this group. Once created I try to select one of these choices and the button won't show as being selected. Has anyone had this issue. I'm very new and am probably sure it might be a minor issue. Hope someone can point me in the right direction. Thanks. p-rat wrote: >I have a form that I have created an Option group for.There are 8 >choices within this group. Once created I try to select one of these >choices and the button won't show as being selected. > >Has anyone had this issue. I&...

Embedding graphics in html emails, how to without coding path to graphic in, pls?
I have a really neat smiley programs that somehow "injects" animated gifs into an html email. So that's great when I'm at home and I want to embed pictures like animated smileys, etc. But at the office I have no such program and am not allowed to install one, of course. How can I do the same thing at the office _without_ having to tamper with the html file to begin with? Is there a way? Hope so, I'd like to be able to attach smileys, etc., without hardcoding them in. It would be too tough to type up the emails in html each time and adding path to gif, etc. Thank yo...

Working on Excel from VC++
Hi, Can some one send me pointers to information of the EXCEL Object Model when working from VC++? All the info I found was on VB. If some one has a class for this - it will be fine as well. Thanks, Tal. There are bunch of office automation examples in MSDN: http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com: 80/support/kb/articles/Q196/7/76.ASP&NoWebContent=1&NoWebContent=1 -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com <dushkin@012.net.il> wrote in message news:faecfce7.0403030709.5520bf19@posting.google.com... > Hi, > Can some one send me ...

Macro Only working on my PC
Hi, I am very new to Macro's and have no experience. I have created a VERY basic macro on a spreadsheet, where you click a button named "complete" and it automaticly turns the spreadsheet into a attachment on an email. It works perfectly fine on my PC, but it doesn't work for anyone else?? Can anyone help please? PS I am using excel 2007 How about posting the code so we can see what you are doing? best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "J Wheatley" <J Wheatley@discussions.microsoft.com&...

SelectSingleNode question
This is a multi-part message in MIME format. ------=_NextPart_000_000A_01C4D0E5.4D4014F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am somewhat new to extracting data from an XML document in .Net. My document looks like this: <?xml version=3D"1.0" encoding=3D"UTF-8"?> <RMA-Standard> <IncomeData> <NetSales>64000000</NetSales> <COGS>80.0</COGS> <ProfitBeforeTax>6.0</ProfitBeforeTax> </IncomeData> </RMA-Standard> I tried to do the followin...

If.. AND If.. Then coding question
I use a form with check boxes. I currently have code that If one box is checked Then change a list to "1" Private Sub XXX_AfterUpdate() If (Me.XXX = -1) Then Me.List117 = "1" End If I want to write a code that if two (or more) boxes are checked Then change list to 2 I tried this but it didn't work Private Sub XXX_AfterUpdate() If (Me.XXX = -1) and If (If Me.YYY = -1 ) Then Me.List117 = "2" End If I would appreciate any help. Try this Private Sub XXX_AfterUpdate() If Me.XXX = -1 and Me.YYY = -1 Then Me.List117 = "2"...

work schedule again
Hey there, I'm looking all over the web for a template which suits about 12 employees. They work sometimes split and double shifts (and me 24/7). I thought it automatically inserts the date for each day, suggest a 8.5 hours shift (but still can insert more or less), add the hours in the end and tells me if someone is working more than 5 days/ week so they get the time off in lieu. It would also be an advantage if it shows if the current week is a even ore uneven one(trainees go to school). And the cherry on top is if it could mark public holidays (preferable the ones in Germany). So, I...

Outlook using https wont work- OWA works but not through Outlook
Hello, I have seen a few different posts on this topic bad none of them have worked for me. On this server "apparantly" owa and outlook over https have previsouly worked. OWA works, using url http and https. So the ports can not be blocked. outlook over https functions in exactly the same way. When I try to set up Outlook 2003 to connect to Exchange using HTTP, and put as the HTTP proxy server https://server/domain.com/exchange, (same url that works in OWA). I get an error message immediately, almost as if it's doing local syntax checking rather than trying the server connect...

Emails containing hyperlinks not working from Preview Pane
If I double-click an email contain a hyperlink from my Inbox and click a hyperlink, the web page is properly displayed. However, when I click on the same hyperlink from the Preview Pane the hyperlink does not connect me to the web page. Any ideas? See if the problem persists in a new named identity. If that does not help, continue with this. Hyperlinks do not work in Outlook Express or in Word (Revised 29 Apr-09) http://support.microsoft.com/kb/823301 Hyperlinks do not work in Outlook Express after you upgrade to IE7 [and/or IE8] (Revised 29 Apr-09) http://support.m...

IMF automatic updates not working.
I followed the whitepaper on how to turn on automatic IMF updates in Exchange 2003 but it's not working, at least I don't think it is. No new files show up in the Exchsrvr\bin\MCSFV2 folder. How can I check to see if the IMF database is actually being updated? Which whitepaper? This short article contains all the necessary details: http://www.exchangeinbox.com/articles/016/imfupdates.htm and make sure that you are using Microsoft Updates not Windows Updates. -- Alexander Zammit WinDeveloper Software IMF Tune - Unleash the Full Intelligent Message Filter Power http://www.windevel...

multi criteria code
hello every one I have this code from Northwind sample. Private Sub ReviewProducts_Click() ' This code created in part by Command Button Wizard. On Error GoTo Err_ReviewProducts_Click Dim strMsg As String, strTitle As String Dim intStyle As Integer Dim strDocName As String, strLinkCriteria As String ' If CompanyName control is blank, display a message. If IsNull(Me![CompanyName]) Then strMsg = "Move to the supplier record whose products you want to see, then press the Review Products button again." intStyle = vbOKOnly strTitle ...