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 June 5th, 2006, 06:10 AM
Authorized User
 
Join Date: May 2005
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
 
Old June 7th, 2006, 04:53 AM
Authorized User
 
Join Date: May 2005
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





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





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