Solved

How to read XML schema data into variables using ASP (VB or Javascript)

Posted on 2007-04-04
3
680 Views
Last Modified: 2008-01-09
Hi , Please hlep me to read XML data from ASP (using VBscript or Javascript).  
All i want is to get the values of Name,Telephone and Email in to seperate variables  and display them in the browser using vbscript or javascript in ASP.
thanks - krs_rama

Here is my XML File (website and other things are renamed on purpose) :
<?xml version="1.0" encoding="utf-8"?>
<DataSet xmlns="http://someurl.net/maint">
      <xs:schema id="Accounts" targetNamespace="http://someurl.net/maint" xmlns:mstns="http://someurl.net/maint" xmlns="http://someurl.net/maint" xmlns:xs="http://www.url.com/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
            <xs:element name="Accounts" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
                  <xs:complexType>
                        <xs:choice minOccurs="0" maxOccurs="unbounded">
                              <xs:element name="Account">
                                    <xs:complexType>
                                          <xs:sequence>
                                                <xs:element name="Name" type="xs:string" minOccurs="0"/>                                                
                                                <xs:element name="E_Mail" type="xs:string" minOccurs="0"/>
                                                <xs:element name="Telephone" type="xs:string" minOccurs="0"/>                                                
                                          </xs:sequence>
                                    </xs:complexType>
                              </xs:element>
                        </xs:choice>
                  </xs:complexType>
            </xs:element>
      </xs:schema>
      <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
            <Accounts>
                  <Account diffgr:id="Account1" msdata:rowOrder="0" diffgr:hasChanges="inserted">                        
                        <Name>John Trevor</Name>                        
                        <E_Mail>testchat@worldwideweb.com</E_Mail>
                        <Telephone>1888324366</Telephone>                        
                  </Account>
            </Accounts>
      </diffgr:diffgram>
</DataSet>

0
Comment
Question by:krs_rama
3 Comments
 
LVL 8

Accepted Solution

by:
jwarnken earned 50 total points
Comment Utility
The Scripting guys have a good example of how to read xml into vbscript

http://www.microsoft.com/technet/technetmag/issues/2007/02/HeyScriptingGuy/
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now