Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
|
|
ASP Script to Search XMLASP script showing how to search / find records in an XML document. <%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<TITLE>ASP Script to Search XML</TITLE>
</HEAD>
<BODY>
<%
' Create an ASP XML parser object
set xml0 = Server.CreateObject("Chilkat.Xml")
' Returns the XML page as a Variant
set xml = xml0.HttpGet("http://www.xml-parser.com/companies.xml")
' Find all companies located in California
' Navigate to the first company record.
xml.FirstChild2()
' Find the next XML node where there is a child node having tag "name"
' with a value that matches the wildcarded pattern "Microsoft*"
Response.write "<h2>Companies with Headquarters in California</h2>"
While Not (xml Is Nothing)
' FindNextRecord *will* return the current record if it
' matches the criteria.
set xml = xml.FindNextRecord("state", "CA")
If Not (xml Is Nothing) Then
' Add the company name to the listbox.
Response.write(xml.GetChildContent("name") + "<br>")
' Advance past this record.
set xml = xml.NextSibling()
End If
Wend
%>
</BODY>
</HTML>
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.