SQL Server Stored Procedure Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

SQL Server
Stored Procedure Examples

Quick Start
Encryption
File Access
IMAP
POP3
SMTP
Email Object
FTP
HTML-to-XML
HTTP
MHT
MIME
RSA Encryption
Socket
Spider
String
Tar
Upload
XML
XMP
Zip

Byte Array
RSS
Atom
Self-Extractor

Parse a Google Sitemap

How to parse a Google sitemap.

CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @iTmp0 int

    DECLARE @xml int
    EXEC @hr = sp_OACreate 'Chilkat.Xml', @xml OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    --  The Chilkat XML component is freeware.

    --  Load an XML sitemap:
    EXEC sp_OAMethod @xml, 'LoadXmlFile', NULL, 'sitemap.xml'

    --  Iterate over the URL nodes:
    DECLARE @xUrl int

    EXEC sp_OAMethod @xml, 'FirstChild', @xUrl OUT

    --  Loop over the records in the sitemap and display each URL.
    WHILE !(@xUrl Is Nothing )
      BEGIN

        EXEC sp_OAMethod @xUrl, 'GetChildContent', @iTmp0 OUT, 'loc'        PRINT @iTmp0

        EXEC sp_OAMethod @xUrl, 'NextSibling', @xUrl OUT
      END
END
GO

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2007 Chilkat Software, Inc. All Rights Reserved.