Advertise Here
XML Files - Extensible Markup Language Tutorials for Developers - Web03
Extensible Markup Language

Search XML Files:

DEVELOPER CHANNEL
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

Find a Web Host With:
CGI Capabilities
Active Server Pages
Windows Hosting
Unix Hosting
Dedicated Servers
     
 Advanced Search
 Be a Commerce Partner















IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

A Couple of ASP Functions for XML Data Transfer

By
sjuarez1979@hotmail.com

Introduction

One of our visitors decided they would give something back. It's not much, but here are a couple of ASP functions for XML Data transfer that they found to be very useful.

Two functions that allow for XML Data transfer

getXMLField


Function getXMLField(strFieldName)

    Dim objDom
    Dim objRoot
    Dim objField
    Dim strFile
    Dim PageNo

    PageNo = Request.QueryString("page")
    If PageNo = "" Then
        PageNo = "1"
    End If

    'Page Number
    strFile = "Page" & PageNo & ".xml"

    'XML file object
    Set objDom = Server.CreateObject("Microsoft.XMLDOM")
    objDom.async = False
    strXMLFile = Server.MapPath(strFile)
    objDom.Load (strXMLFile)

    'Root XML Field
    Set objRoot = objDom.documentElement

    'collect information from nodes
    Set objField = objRoot.selectSingleNode(strFieldName)

    getXMLField = objField.Text

    'Release variables
    Set objDom = Nothing
    Set objRoot = Nothing
    Set objField = Nothing

End Function

updateXMLField


Function updateXMLField(strFieldName, strData2BInserted, strXMLFile)

    Dim objDom
    Dim objRoot
    Dim objField

    'XML file object
    Set objDom = Server.CreateObject("Microsoft.XMLDOM")
    objDom.async = False
    objDom.Load strXMLFile

    'Root XML Field
    Set objRoot = objDom.documentElement

    'Select single XML node given the node name
    Set objField = objRoot.selectSingleNode(strFieldName)

    'update field
    objField.Text = strData2BInserted

    objDom.save strXMLFile
    updateXMLField = True

    'Release all objects
    Set objDom = Nothing
    Set objRoot = Nothing
    Set objField = Nothing

End Function

Thanks to sjuarez1979@hotmail.com for the above code!

If you've got an article or a code snippet that you'd to share, drop us an email.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 DevX XML Content 
- Persisting Data in Your Windows Mobile Device
- Generating Reports and Statistics in PHP
- Leveraging Silverlight 2 with SQL Server and XML
- Enable WPF/Windows Forms Interoperability with WPF Commands
- Getting Started with XForms in OpenOffice

Jump to : Top Of Page or HOME




JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES