MS SQL Server
  Home arrow MS SQL Server arrow Page 7 - XML and the SQL 2000 Server part 3: XML Da...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MS SQL SERVER

XML and the SQL 2000 Server part 3: XML Data with XPath Queries
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 12
    2005-05-25

    Table of Contents:
  • XML and the SQL 2000 Server part 3: XML Data with XPath Queries
  • Xpath Queries
  • XDR Schema and XML View Mapper
  • Adding an SQL Module
  • Generating and Mapping an XDR Schema
  • Testing an Xpath Query Using the Internal Tester
  • Exporting Schema and Query in URL
  • Xpath Query With a Template File

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    XML and the SQL 2000 Server part 3: XML Data with XPath Queries - Exporting Schema and Query in URL


    (Page 7 of 8 )

    Exporting the XDR Schema

    Once the Xpath query verification is finished, you can save the project and export the XDR file by right clicking on the .smm file, or from
    Tools->Export XDR Schema..., which produces an XML document. Now you save this document in the Schema folder of the SQL 2000 Server specific virtual directory discussed in
    Part 1. The Xpath queries can now be executed by including them in the URL, or by including them in a template file.

    Virtual directory for testing the Xpath queries

    In order to test the Xpath queries using the XML View, a virtual directory was created in the SQL 2000 specific IIS with the following settings:

    IIS Virtual Directory Server: XPHTEK
    Virtual Directory Name: TestPath  Local Path:c:\TestXPath\xschema\
    Windows Integrated Security
    SQL Server (local)
    Database: TestWiz
    Settings: Allow URL Queries, Allow template queries, Allow XPath
    Virtual names: 
    xobj
    xschema  C:\TestXPath\xschema
    xtemplate C:\TestXPath\xtemplate.
    

    Xpath query in a URL

    The syntax for specifying an Xpath query in an URL is as follows:
    http://IISServer/VirtualRoot/SchemaVirtualName/
    SchemaFile/XPathQuery[?root=ROOT]

    For the virtual directory settings shown above this will be:
    http://XPHTEK/TestPath/xschema/TestWizView.xml/color?root=root. The browser display for this query is shown in the next picture. The TestWizView.xml file[produced by the XML Viw Mapper] is saved in the c:\TestXPath \xschema folder. This query returns all the elements from the color table

    If the query returns a single record, then it can be made to return an xml document by issuing the following query:
    http://XPHTEK/TestPath/xschema/TestWizView.xml/color[@colid=2]
    The Xpath query is color[@colid=2].This would then result in the following returned result shown in this picture.

    More MS SQL Server Articles
    More By Jayaram Krishnaswamy


     

    MS SQL SERVER ARTICLES

    - Completing the Introduction to Transact-SQL
    - A Brief Introduction to Transact-SQL
    - Lookups and Blocking Bad Data
    - Field Validation Rules for Blocking Bad Data
    - Using Masks to Block Bad Data
    - Blocking Bad Data
    - Using @@ROWCOUNT and TABLE Variables for Dat...
    - How to Use Variables, IF and CASE in Databas...
    - Creating Important Aspects of Notification S...
    - Working wth Variables in Database Interactio...
    - Delving Deeper into Notification Services
    - Notification Services
    - Building a Multi-table Report with SQL 2005 ...
    - A Secure Way of Building Connection Strings
    - Transferring a Database Using the SSIS Desig...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT