Advertise Here
XML Files - Extensible Markup Language Tutorials for Developers - Web05
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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
New at Developer.com/Voice/
- Designing an Interactive Voice Response System Using VoiceXML and CCXML
- Nominations for Developer.com Product of the Year Begin October 15
- Speech Authentication Strategies, Risk Mitigation, and Business Metrics
- Implementing Extension Methods in VB.NET
 DevX XML Content 
- Processing Linked Web Data with XSLT
- Using StAX to Clone an XML Document
- Ten Pitfalls of Enterprise Ontology Management
- WPF Meets the iPhone
- The Easiest and Most Efficient Way to Modify XML Documents

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
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
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
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
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
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES