Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP XML
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 5th, 2006, 06:10 AM
Authorized User
 
Join Date: May 2005
Location: rajkot, gujarat, India.
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shaileshk Send a message via Yahoo to shaileshk
Default xml Files read in asp with formated data

My xml file format is below

<content> node have HTML format data i read xml file i got values but not in html format i also post asp code for reading xml file


Code:
<articles>
<article>
<date>2006-05-22</date>
<time>08:48:52</time>
<author>News Service</author>
<headline>
Better training, more recruitment for forces to counter extremists
</headline>
<cats>India</cats>
<subcats>National</subcats>
<content>
<p align='justify'>
<b>New Delhi, May 22 </b> With insurgents being better equipped and using newer techniques of attack, India's police and paramilitary forces are being forced to go in for superior training and mass recruitment to counter the growing challenge from extremists, be they Maoists or Kashmiri militants.
</p><p align='justify'>
'The nature of attacks has changed. The element of surprise is much greater,' a senior officer of the Central Reserve Police Force (CRPF), that is at the forefront of the fight against insurgents, told IANS.
</p><p align='justify'>
</p><p align='justify'>
'Thus, we have decided to train the police forces (in Maoist-affected states) to counter such attacks. These men would be trained in counter insurgency and jungle warfare techniques along with the CRPF personnel,' the officer added.
</p><p align='justify'>
</p><p align='justify'>
This apart, the government has also decided to raise nine more India Reserve Battalions and deploy them in the 14 states infested with Maoists. A special effort is also being made to recruit personnel in Jammu and Kashmir for deployment on counter-insurgency operations.
</p><p align='justify'>
</p><p align='justify'>
'We are recruiting around 4,000 people from Kashmir,' the officer said.
</p><p align='justify'>
</p><p align='justify'>
During the past year, Maoists carried out 1,596 attacks in the country, killing over 1,000 security personnel, apart from a large number of civilians.
</p><p align='justify'>
</p><p align='justify'>
The CRPF officer said that while the Maoists had earlier relied largely on ambushes, they were now resorting to a variety of techniques.
</p><p align='justify'>
</p><p align='justify'>
For instance, in a recent incident in Chhattisgarh's Dantewada district, Maoists placed improvised explosive devices (IEDs) beneath the bodies of three villagers they had hacked to death.
</p><p align='justify'>
</p><p align='justify'>
'The local police was looking for these three villagers. When they got information that three bodies had been thrown on the highway, they reached the spot and tried to remove the bodies but the IEDs exploded, killing some of them,' the officer said.
</p><p align='justify'>
</p><p align='justify'>
In another incident, the extremists had carried out simultaneous attacks at seven different places in Dantewada district.
</p><p align='justify'>
</p><p align='justify'>
'They were waiting outside places like the district administration headquarters, police stations and other places and started firing,' the officer said.
</p><p align='justify'>
</p><p align='justify'>
'This was meant to create panic within the security forces and among the people of the area,' the officer pointed out, adding the attacks were one of the most well-coordinated in the area.
</p><p align='justify'>
</p><p align='justify'>
Then, there was an attack on a police station in which Maoists looted arms and ammunition.
</p><p align='justify'>
</p><p align='justify'>
'In this attack, the Naxals (Maoists) came in the garb of a marriage party to the police station, which was located close to the highway,' the officer said.
</p><p align='justify'>
</p><p align='justify'>
'They came in a bus and suddenly opened fire. The policemen were caught unawares as they never expected such an attack in broad daylight,' he added.
</p>
</content>
<summary>
New Delhi, May 22  With insurgents being better equipped and using newer techniques of attack, India's police and paramilitary forces are being forced to go in for superior training and mass recruitment to counter the growing challenge from extremists, be they Maoists or Kashmiri militants.
</summary>
<copyright>News Service</copyright>
</article>
</articles>
asp code for xml file read

Code:
***************************************Read XML File From the News server**************
Dim xml
 Set xml = Server.CreateObject("Microsoft.XMLDOM")
 xml.async = False
' strpath=Server.MapPath("/../XML/")+"\"+XMLfilename
strpath="your XML Path"

 xml.load (strpath)
 response.write strpath
Dim dt,tm,author,headline,cat,subcat,content,summary,copyright 
Set dtn= xml.getElementsByTagName("date")
dt=dtn(0).text

Set tmn= xml.getElementsByTagName("time")
tm=tmn(0).text

Set authorn= xml.getElementsByTagName("author")
author=authorn(0).text

Set headlinen= xml.getElementsByTagName("headline")
headline=headlinen(0).text

Set catsn= xml.getElementsByTagName("cats")
cats=catsn(0).text


Set subcatsn= xml.getElementsByTagName("subcats")
subcats=subcatsn(0).text


Set summaryn= xml.getElementsByTagName("summary")
summary=summaryn(0).text

Set copyrightn= xml.getElementsByTagName("copyright")
copyright=copyrightn(0).text

Set contentn= xml.getElementsByTagName("content")
content=contentn(0).text
Response.Write(content)



shailesh kavathiya
__________________
Shailesh Kavathiya
===============
Good Morning SMS
Reply With Quote
  #2 (permalink)  
Old June 7th, 2006, 04:53 AM
Authorized User
 
Join Date: May 2005
Location: rajkot, gujarat, India.
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shaileshk Send a message via Yahoo to shaileshk
Default

content=contentn(0).Xml

shailesh kavathiya
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read xml data itHighway Classic ASP Basics 4 December 2nd, 2008 04:46 AM
xml file read data from servlet kotaiah J2EE 0 October 15th, 2006 06:37 AM
How do I read all the xml files in a directory hkec C# 0 May 11th, 2006 01:10 AM
a problem about read and write the xml files watson .NET Web Services 0 September 5th, 2004 09:25 PM
a problem about read and write the xml files watson C# 0 September 4th, 2004 10:33 AM



All times are GMT -4. The time now is 11:22 AM.


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