Wrox Programmer Forums
|
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 12th, 2011, 03:26 AM
Registered User
 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to query on xml data

Hi,

I have try to retrieve data from a xml file. I write following code to query on xml. But don't get expected result. It return Zero nodeLenght.
Please help me.

Naznin Nahar.

MY code-

Code:
Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.async = false
xmlDoc.Load Server.MapPath("\Data\XML Data\strFile.xml")

set xmlNode =xmlDoc.selectNodes("//rs:data/z:row[(@C_ID=8 and @S_TYPE='Skill')]")

nodeLength=xmlNode.length
XML file -

<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly' rs:CommandTimeout='30'>
<s:AttributeType name='S_C_ID' rs:number='1'>
<s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true' rs:maybenull='false'/>
</s:AttributeType>
<s:AttributeType name='C_ID' rs:number='2' rs:nullable='true' rs:writeunknown='true'>
<s:datatype dt:type='ui1' dt:maxLength='1' rs:precision='3' rs:fixedlength='true'/>
</s:AttributeType>
<s:AttributeType name='S_NAME' rs:number='3' rs:nullable='true' rs:writeunknown='true'>
<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='S_TYPE' rs:number='4' rs:nullable='true' rs:writeunknown='true'>
<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='20'/>
</s:AttributeType>
<s:AttributeType name='SNO' rs:number='5' rs:nullable='true' rs:writeunknown='true'>
<s:datatype dt:type='ui1' dt:maxLength='1' rs:precision='3' rs:fixedlength='true'/>
</s:AttributeType>
<s:extends type='rs:rowbase'/>
</s:ElementType>
</s:Schema>
<rs:data>
<z:row S_C_ID='688' C_ID='8' S_NAME='VIZ Render' S_TYPE='Skill'/>
<z:row S_C_ID='689' C_ID='8' S_NAME='GIS' S_TYPE='Skill'/>
<z:row S_C_ID='690' C_ID='8' S_NAME='CADD' S_TYPE='Skill'/>
<z:row S_C_ID='764' C_ID='2' S_NAME='Capital Market/Investment Banking' S_TYPE='Skill'/>
<z:row S_C_ID='765' C_ID='2' S_NAME='Remittance' S_TYPE='Skill'/>
<z:row S_C_ID='766' C_ID='2' S_NAME='International Banking' S_TYPE='Skill'/>
<z:row S_C_ID='767' C_ID='2' S_NAME='Syndicated Loan Management' S_TYPE='Skill'/>
<z:row S_C_ID='768' C_ID='4' S_NAME='Accounting' S_TYPE='Skill'/>
<z:row S_C_ID='820' C_ID='4' S_NAME='Media &#x26; Communication' S_TYPE='Skill'/>
<z:row S_C_ID='821' C_ID='4' S_NAME='Advertising' S_TYPE='Skill'/>
<z:row S_C_ID='822' C_ID='4' S_NAME='Photography' S_TYPE='Skill'/>
<z:row S_C_ID='335' C_ID='2' S_NAME='General Banking' S_TYPE='Work Area' SNO='1'/>
<z:row S_C_ID='376' C_ID='4' S_NAME='Teaching/Training' S_TYPE='Work Area' SNO='1'/>
<z:row S_C_ID='377' C_ID='4' S_NAME='Education Administration/Management' S_TYPE='Work Area' SNO='2'/>
<z:row S_C_ID='336' C_ID='2' S_NAME='Retail Banking' S_TYPE='Work Area' SNO='2'/>
<z:row S_C_ID='337' C_ID='2' S_NAME='Corporate' S_TYPE='Work Area' SNO='3'/>
<z:row S_C_ID='378' C_ID='4' S_NAME='Education Counseling' S_TYPE='Work Area' SNO='3'/>
<z:row S_C_ID='428' C_ID='8' S_NAME='Software Architect' S_TYPE='Work Area' SNO='3'/>
<z:row S_C_ID='429' C_ID='8' S_NAME='Project Manager (Software)' S_TYPE='Work Area' SNO='4'/>
<z:row S_C_ID='1012' C_ID='2' S_NAME='Relationship' S_TYPE='Work Area' SNO='34'/>
</rs:data>
</xml>
 
Old July 3rd, 2012, 01:41 AM
Registered User
 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SQL Server includes the ability to run queries that create XML data from your tables. XML provides standard formatting, so you can transfer data between heterogeneous platforms. The SQL "XML path" function sets up the root and the data inserts into XML nodes when the data displays. You can view the data in Management Studio or copy and paste the data to a text file to store the information in a separate location click here for more info





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple input xml / get data from other xml file elayaraja.s XSLT 3 July 25th, 2008 06:59 AM
VB.net, adding XML data to an existing XML file saikoboarder XML 11 April 17th, 2008 04:19 PM
pls give the query for XML data in Sqlserver2005 veeruu SQL Server 2005 0 July 27th, 2006 05:07 AM
pls give query to diplay XML data in Sqlserver2005 veeruu XML 0 July 27th, 2006 05:06 AM
How to Query XML Data from XSLT Form kwilliams XSLT 1 December 3rd, 2005 06:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.