473,657 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I remove a line from incoming XML FILE

I have this XML FILE where I am reading data from and it has this node
doctype "< ! D O C T Y P E a d f S Y S T E M " h t t p : / / w h o s c
a l l i n g . c o m / d t d / a d f d t d . d t d " > "

ONLY When I remove this line I could display the data onto the browser, any
ideas WHY? if not I am using following code to remove the above line, it
doesn't work

Dim FindWhat, ReplaceWith

'dim MyString
'MyString= "Hello" & chr(34) & "World" & chr(34) & "World"

FindWhat = "< ! D O C T Y P E &nbsp;&nbsp; a d f &nbsp; S Y S T E M &nbsp;
" & chr(34) & " h t t p : / / w h o s c a l l i n g . c o m / d t d / a d f
d t d . d t d " & chr(34) & "&nbsp;>"
'FindWhat = FindWhat & " h t t p : / / w h o s c a l l i n g . c o m / d t
d / a d f d t d . d t d "
'FindWhat = FindWhat & ">"

response.write "FindWhat :" & FindWhat & "<br>"

ReplaceWith = ""

Dim fso, sText, fs, DestinationFile , writingFile, sPath
set fso = createobject("s cripting.filesy stemobject")
sPath = "D:\inetpub\Pen nyFlyer\carmart new\business_iv r.xml"

if fso.FileExists( sPath) then

Set fs = fso.OpenTextFil e(sPath)
sText = fs.ReadAll()

'response.write "sText" & sText

sText = Replace(sText, FindWhat, ReplaceWith)

DestinationFile = "D:\inetpub\Pen nyFlyer\carmart new\newbusiness _ivr.xml"

Set writingFile = fso.CreateTextF ile(Destination File,true,false )

WritingFile.Wri te(sText)

WritingFile.Clo se
end if

Thanks
Jul 19 '05 #1
3 1930
What error message do you get in the browser?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Girish" <gi********@yah oo.com> wrote in message
news:Ot******** ******@TK2MSFTN GP12.phx.gbl...
I have this XML FILE where I am reading data from and it has this node
doctype "< ! D O C T Y P E a d f S Y S T E M " h t t p : / / w h o s c a l l i n g . c o m / d t d / a d f d t d . d t d " > "

ONLY When I remove this line I could display the data onto the browser, any ideas WHY? if not I am using following code to remove the above line, it
doesn't work

Dim FindWhat, ReplaceWith

'dim MyString
'MyString= "Hello" & chr(34) & "World" & chr(34) & "World"

FindWhat = "< ! D O C T Y P E &nbsp;&nbsp; a d f &nbsp; S Y S T E M &nbsp; " & chr(34) & " h t t p : / / w h o s c a l l i n g . c o m / d t d / a d f d t d . d t d " & chr(34) & "&nbsp;>"
'FindWhat = FindWhat & " h t t p : / / w h o s c a l l i n g . c o m / d t d / a d f d t d . d t d "
'FindWhat = FindWhat & ">"

response.write "FindWhat :" & FindWhat & "<br>"

ReplaceWith = ""

Dim fso, sText, fs, DestinationFile , writingFile, sPath
set fso = createobject("s cripting.filesy stemobject")
sPath = "D:\inetpub\Pen nyFlyer\carmart new\business_iv r.xml"

if fso.FileExists( sPath) then

Set fs = fso.OpenTextFil e(sPath)
sText = fs.ReadAll()

'response.write "sText" & sText

sText = Replace(sText, FindWhat, ReplaceWith)

DestinationFile = "D:\inetpub\Pen nyFlyer\carmart new\newbusiness _ivr.xml"

Set writingFile = fso.CreateTextF ile(Destination File,true,false )

WritingFile.Wri te(sText)

WritingFile.Clo se
end if

Thanks

Jul 19 '05 #2
Your attachment opens and displays just fine in IE on my system.

If you are just having problems reading it in and re-writing it why don't
you open it and re-save it with the MSXML component instead of the file
system object?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Girish" <gi********@yah oo.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
well, it creates a file called newbusiness_ivr .xml and the file should
contain everything and the node doctype replaced by "" right? It doesn't it just has the following partial data:
=============== =============== =============== =============== =============== = ==========
˙ţ<
< e m a i l > t j a v a @ w h o s c a l l i n g . c o m < / e m a i l >

< p h o n e > 8 6 6 3 1 2 2 2 2 2 < / p h o n e >

< / c o n t a c t >

< / p r o v i d e r >

< / p r o s p e c t >

< / a d f >
=============== =============== =============== =============== =============== = ==========
I am also attaching business_ivr.xm l file which is parsed and contains the
above node.

Thanks

"Mark Schupp" <ms*****@ielear ning.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
What error message do you get in the browser?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Girish" <gi********@yah oo.com> wrote in message
news:Ot******** ******@TK2MSFTN GP12.phx.gbl...
I have this XML FILE where I am reading data from and it has this node
doctype "< ! D O C T Y P E a d f S Y S T E M " h t t p : / / w h o
s
c
a l l i n g . c o m / d t d / a d f d t d . d t d " > "

ONLY When I remove this line I could display the data onto the
browser,
any
ideas WHY? if not I am using following code to remove the above line,
it doesn't work

Dim FindWhat, ReplaceWith

'dim MyString
'MyString= "Hello" & chr(34) & "World" & chr(34) & "World"

FindWhat = "< ! D O C T Y P E &nbsp;&nbsp; a d f &nbsp; S Y S T E M

&nbsp;
" & chr(34) & " h t t p : / / w h o s c a l l i n g . c o m / d t d /

a d
f
d t d . d t d " & chr(34) & "&nbsp;>"
'FindWhat = FindWhat & " h t t p : / / w h o s c a l l i n g . c o m
/ d
t
d / a d f d t d . d t d "
'FindWhat = FindWhat & ">"

response.write "FindWhat :" & FindWhat & "<br>"

ReplaceWith = ""

Dim fso, sText, fs, DestinationFile , writingFile, sPath
set fso = createobject("s cripting.filesy stemobject")
sPath = "D:\inetpub\Pen nyFlyer\carmart new\business_iv r.xml"

if fso.FileExists( sPath) then

Set fs = fso.OpenTextFil e(sPath)
sText = fs.ReadAll()

'response.write "sText" & sText

sText = Replace(sText, FindWhat, ReplaceWith)

DestinationFile =

"D:\inetpub\Pen nyFlyer\carmart new\newbusiness _ivr.xml"
Set writingFile = fso.CreateTextF ile(Destination File,true,false )

WritingFile.Wri te(sText)

WritingFile.Clo se
end if

Thanks



Jul 19 '05 #3
u mean that node is not giving problem, r u reading its data via ASP and
displaying it? if yes, please send me some sample and / or URL on MSXML
component please...

Thanks much!
"Mark Schupp" <ms*****@ielear ning.com> wrote in message
news:uk******** ******@TK2MSFTN GP11.phx.gbl...
Your attachment opens and displays just fine in IE on my system.

If you are just having problems reading it in and re-writing it why don't
you open it and re-save it with the MSXML component instead of the file
system object?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Girish" <gi********@yah oo.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
well, it creates a file called newbusiness_ivr .xml and the file should
contain everything and the node doctype replaced by "" right? It doesn't
it
just has the following partial data:

=============== =============== =============== =============== =============== =
==========
˙ţ<
< e m a i l > t j a v a @ w h o s c a l l i n g . c o m < / e m a i
l >

< p h o n e > 8 6 6 3 1 2 2 2 2 2 < / p h o n e >

< / c o n t a c t >

< / p r o v i d e r >

< / p r o s p e c t >

< / a d f >

=============== =============== =============== =============== =============== = ==========
I am also attaching business_ivr.xm l file which is parsed and contains the above node.

Thanks

"Mark Schupp" <ms*****@ielear ning.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
What error message do you get in the browser?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Girish" <gi********@yah oo.com> wrote in message
news:Ot******** ******@TK2MSFTN GP12.phx.gbl...
> I have this XML FILE where I am reading data from and it has this node > doctype "< ! D O C T Y P E a d f S Y S T E M " h t t p : / / w

h o
s
c
> a l l i n g . c o m / d t d / a d f d t d . d t d " > "
>
> ONLY When I remove this line I could display the data onto the
browser, any
> ideas WHY? if not I am using following code to remove the above
line, it > doesn't work
>
> Dim FindWhat, ReplaceWith
>
> 'dim MyString
> 'MyString= "Hello" & chr(34) & "World" & chr(34) & "World"
>
> FindWhat = "< ! D O C T Y P E &nbsp;&nbsp; a d f &nbsp; S Y S T E M
&nbsp;
> " & chr(34) & " h t t p : / / w h o s c a l l i n g . c o m / d t d
/ a
d
f
> d t d . d t d " & chr(34) & "&nbsp;>"
> 'FindWhat = FindWhat & " h t t p : / / w h o s c a l l i n g . c o
m /
d
t
> d / a d f d t d . d t d "
> 'FindWhat = FindWhat & ">"
>
> response.write "FindWhat :" & FindWhat & "<br>"
>
> ReplaceWith = ""
>
> Dim fso, sText, fs, DestinationFile , writingFile, sPath
> set fso = createobject("s cripting.filesy stemobject")
> sPath = "D:\inetpub\Pen nyFlyer\carmart new\business_iv r.xml"
>
> if fso.FileExists( sPath) then
>
> Set fs = fso.OpenTextFil e(sPath)
> sText = fs.ReadAll()
>
> 'response.write "sText" & sText
>
> sText = Replace(sText, FindWhat, ReplaceWith)
>
> DestinationFile =

"D:\inetpub\Pen nyFlyer\carmart new\newbusiness _ivr.xml"
>
> Set writingFile = fso.CreateTextF ile(Destination File,true,false )
>
> WritingFile.Wri te(sText)
>
> WritingFile.Clo se
> end if
>
> Thanks
>
>



Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3124
by: simonc | last post by:
I've been programming in assembler and C/C++ for a number of years, but I'm only just starting down the road of PHP & MYSQL. I have a couple of questions: (1) Before I start writing my own code, to learn from, and also avoid re-inventing the wheel, does anyone know of any existing source that implements a (basic or complex) play-by-email system using PHP and maybe MYSQL?
8
2832
by: JT | last post by:
i have written some asp that reads a fixed length text file, line by line, inserting each line into my database. my problem is that the text file format seems to have extra space at the end of the file so my code thinks there is actually one more line when there is not. is there a way to remove these spaces before i loop through the file? here is my sample code: Do While df.AtEndOfStream <> True line = df.ReadLine
2
9487
by: collinm | last post by:
hi here my code FILE *fp; char *line; #define LINE_MAX 30 fp = fopen("test1.txt", "r");
8
1821
by: Ken Capriell | last post by:
I know that subject probably did not adequately explain anything so here goes... I have an access file that needs to be transposed from its current format to a new format so that I can then export as a flat file to be imported into a shopping cart. This file is to create a set of attributes/options for each product. The file I have is in a pretty standard format:
3
3709
by: Li Pang | last post by:
Hi, I want to know the easiest way to remove the last line in a text file, or how to catch the last line of a text file. Thanks in advance
4
2573
by: kaushikshome | last post by:
Can anyone please help me in writing the code in C++ : I want a read a file line by line,remove the lines which have length of a particular field in a line exceeding 63 characters After removing the line the corresponding blank spaces generated after removal of the line also needs to be removed. .. I am in urgent need for this solution.Kindly help how to go about it. Thanks in advance ,
4
57065
by: aSoundMind | last post by:
Hi there, I recieve this error Server Error in '/integrate' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
61
3252
by: arnuld | last post by:
I have created a program which creates and renames files. I have described everything in comments. All I have is the cod-duplication. function like fopen, sprint and fwrite are being called again and again. I know to remove code-duplication I have to make functions and pass arguments to them but I am not able to think of a way doing it. Can you post some example for me, out of this code:
0
1558
by: rahulsengar | last post by:
Hey how can i lauch my application on incoming call notification in windows mobile . hey can u please help me how to launch my application automatically when an incoming call occurs. Is there any way to lauch my application without opening it. The process which i went through was i created a cab file of my application which is working perfectly allright. But my application is not getting started when i deploy the cab file in windows mobile...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.