473,804 Members | 4,153 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MSXML4 - parsing XML Leaves with multiple parameters

Hi, Rather new to MSXML4. I am parsing an XML data-stream over HTTP,
and would like to know why I cannot parse XML nodes with multiple
parameters.

The XML and Code are below, BUT I would like to know how to parse
individual XML nodes when tags are specified as
"<FIELD NAME="collectio n">myVal....... .".

The code below gives me "FIELD" as the value of the XML, not myVal.

All the examples I have found use "<COLLECTION>.. ....." only (without
the parameter).

Some sample code would be good. :)

thanks

Miles.

Sample XML
----

- <RESULTSET FIRSTHIT="1" LASTHIT="10" HITS="10" TOTALHITS="24"
MAXRANK="7909" TIME="0.0780">
- <HIT NO="1" RANK="1908" SITEID="0" MOREHITS="0">
<FIELD NAME="rank">190 8</FIELD>
<FIELD
NAME="docid">c4 2c797ceb8fc321d 762335cb4028b42-deployertest</FIELD>
<FIELD NAME="collectio n">collectio n test</FIELD>
<FIELD NAME="title">te st content- Content</FIELD>
<FIELD NAME="descripti on">test description</FIELD>
</HIT>
[snip]
----
Sample Code
----
<%@ Language="VBScr ipt" %>
<html lang="en">
<head>
<title>Some feeds</title>
<script runat="server" language="VBScr ipt">

Sub OutputFeed ()
Dim returnString
Dim myXML
Dim SoapRequest
Dim SoapURL
Dim myQuery
Dim Loaded

Set SoapRequest = Server.CreateOb ject("MSXML2.XM LHTTP")
Set myXML =Server.CreateO bject("MSXML.DO MDocument")

myXML.Async=Fal se

SoapURL = "http://server/search?query=cr ime"
SoapRequest.Ope n "GET",SoapU RL , False
SoapRequest.Sen d()

Loaded = myXML.load(Soap Request.respons eXML)

If Loaded Then
Dim Items, Item, Title, Link, Description, TitleText,
DescriptionText , LinkURL
Set Items = myXML.documentE lement.selectNo des("//HIT")
Response.Write "<p>Feed from " & SoapURL & " has currently " &
Items.Length & " items.</p>" & VbCrLf
Response.Write "<ul>" & VbCrLf
For Each Item in Items
Set Title = Item.selectSing leNode("title")

If Title Is Nothing Then
TitleText = ""
Else
TitleText = Title.text
End If

Set Link = Item.selectSing leNode("teaser" )

If Link Is Nothing Then
LinkURL = ""
Else
LinkURL = Trim(Link.data)
End If

Set Description = Item.selectSing leNode("descrip tion")
If Description Is Nothing Then
DescriptionText = ""
Else
DescriptionText = Description.dat a
End If

Response.Write "<li><a href=""" & LinkURL & """>" & TitleText & ": "
& DescriptionText & "</a></li>" & VbCrLf
Next
Response.Write "</ul>" & VbCrLf
End If
End Sub
</script>
</head>
<body>
<h1>Some feeds</h1>
<%
OutputFeed()

%>
</body>
</html>

----

Jul 20 '05 #1
0 1476

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1698
by: tweety | last post by:
I had a problem with IE 6.0.2800. The responseText property of the XMLHTTP object was giving an error.There was a bug in msxml dll. so i upgraded to msxml4 and changed the code to the following: try { var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0"); }catch(e)
1
1678
by: T | last post by:
Is there a way to use the Visual Studio .NET IDE to validate a schema using the MSXML4 parser? Similarly, is there a way to get the .NET framework utilities, such as the xsd.exe and wsdl.exe utilities to validate and parse using the MSXML4 parser?
1
3855
by: jd | last post by:
I have an xsl file to generate xml in to an html file. The size of the xsl is 300kb and size of the xml is 47 kb (the size of xml is variable). I am using VB.net to convert the xml file into an html file. The vb.net module peforms following task: load the xml file in XMLDocument object ( I can't use XpathDocument object) load the xsl file in XSLTransform object perform the transformation.
2
1564
by: VernonR | last post by:
I'm having problems getting the .NET 1.1 XSL transform to cross reference using ID / IDREF correctly. I have collapsed to a simple set of files to show the problem more clearly... The output line using MSXML4.0 is correct <Output>First List Item = Hello</Output> The output using MSXML3.0 or the DOTNET XSL transform is <Output> = </Output>
3
3645
by: Eugen Gulinsky | last post by:
Hello guys, I am having problems trying to migrate our MSXML4-compatible stylesheets containing large msxsl:script blocks to a formate understandable by System.Xml:Xsl.XslTransform. I keep getting JS1135 errors saying that some variable was not declared. This scripts worked perfectly with MSXML4. Is there a guide for migraiton from MSXML to .NET or can you just give me some tips on how to resolve this issues without having to change...
17
2795
by: Mark | last post by:
I must create a routine that finds tokens in small, arbitrary VB code snippets. For example, it might have to find all occurrences of {Formula} I was thinking that using regular expressions might be a neat way to solve this, but I am new to them. Can anyone give me a hint here? The catch is, it must only find tokens that are not quoted and not commented; examples follow
7
2516
by: Alan | last post by:
Hi. I have programmed in C++ before, but I`m a couple of years out of practice. I am seeking some advice on getting started on a quickie project. . . . I have to read a 54MB text file and do a pairwise comparison among 2500 items or so in the file. Each of those items have to be compared to every other item. Many of the comparison will only require comparing one field of the items. I will probably sort on this field before I do the...
0
1772
by: =?Utf-8?B?RHVja3dvbg==?= | last post by:
Hello everyone, I need to get the version number of a couple of DLLs (comctl32.dll and msxml4.dll). I don't have the full path because I don't want to assume they will be in the system32 folder. I have a function which first does... //get the current process p = Process.GetCurrentProcess(); //get all the dlls this class is using
3
2707
by: aspineux | last post by:
My goal is to write a parser for these imaginary string from the SMTP protocol, regarding RFC 821 and 1869. I'm a little flexible with the BNF from these RFC :-) Any comment ? tests= def RN(name, regex): """protect using () and give an optional name to a regex""" if name:
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10338
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.