![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
ASP Script to Search XML
ASP 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_9_5_0.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-2026 Chilkat Software, Inc. All Rights Reserved.