473,748 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading Comment Lines(<!-- 2007 -->) from XML File using PHP

4 New Member
Hi,

I want to know, How we will read the XML File Comments using PHP Code.
Thaks in advance.
Mar 13 '07 #1
4 2121
ronverdonk
4,258 Recognized Expert Specialist
Hi,

I want to know, How we will read the XML File Comments using PHP Code.
Thaks in advance.
Your problem is not clear to me. Are you actually reading the xml file and want to skip the comment lines? What is the process you are following to read this file?

Ronald :cool:
Mar 13 '07 #2
manickkarthik
4 New Member
Thanks for your reply. I was reading all other tag data's from XML file, but i can't read the comment line data's. I want to read comment line data's also and diaplay in browser using php code.
Mar 13 '07 #3
ronverdonk
4,258 Recognized Expert Specialist
Show the code you are using to read the xml data.

And display it within php or code tags!!

Ronald :cool:
Mar 13 '07 #4
manickkarthik
4 New Member
XML File:
[XML]
File Name: 'hbwas51_proc_5 4.xml'

<database>
<!-- 2006-12-27 15:45:00 IST / 1167214500 --> <row><v> 3.4102666667e+0 2 </v></row>
<!-- 2006-12-27 15:50:00 IST / 1167214800 --> <row><v> 3.4100000000e+0 2 </v></row>
<!-- 2006-12-27 15:55:00 IST / 1167215100 --> <row><v> 3.4100000000e+0 2 </v></row>
<!-- 2006-12-27 16:00:00 IST / 1167215400 --> <row><v> 3.4178333333e+0 2 </v></row>
<!-- 2006-12-27 16:05:00 IST / 1167215700 --> <row><v> 3.4101333333e+0 2 </v></row>
<!-- 2006-12-27 16:10:00 IST / 1167216000 --> <row><v> 3.5140000000e+0 2 </v></row>
<!-- 2006-12-27 16:15:00 IST / 1167216300 --> <row><v> 3.5140000000e+0 2 </v></row>
<!-- 2006-12-27 16:20:00 IST / 1167216600 --> <row><v> 3.5678666667e+0 2 </v></row>
<!-- 2006-12-27 16:25:00 IST / 1167216900 --> <row><v> 3.5581333333e+0 2 </v></row>
<!-- 2006-12-27 16:30:00 IST / 1167217200 --> <row><v> 3.5581333333e+0 2 </v></row>
<!-- 2006-12-27 16:35:00 IST / 1167217500 --> <row><v> 3.6214000000e+0 2 </v></row>
<!-- 2006-12-27 16:40:00 IST / 1167217800 --> <row><v> 3.6214000000e+0 2 </v></row>
<!-- 2006-12-27 16:45:00 IST / 1167218100 --> <row><v> 3.5512000000e+0 2 </v></row>
<!-- 2006-12-27 16:50:00 IST / 1167218400 --> <row><v> 3.5500000000e+0 2 </v></row>.
</database>

[/XML]


The below code read the row tag values from the above xml file:

[php]
<?php

$doc = new DOMDocument();

$doc->load( 'hbwas51_proc_5 4.xml' );

$rows = $doc->getElementsByT agName("row");
foreach($rows as $node) {
print $node->textContent . " ";
}
[/php]

Now i want to read the comment lines from the above XML file
example comment lines:
<!-- 2006-12-27 15:45:00 IST / 1167214500 -->
Mar 14 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

12
4914
by: Venkat | last post by:
Greetings to All, I have the following file and i need to modify it with the contents of an array File1.txt Name Location Points Grade Venkat,Newyork,100,A Jack,LA,12,C
3
3512
by: syntax | last post by:
hi, i want to read a file using fread() in equal chunks through a for loop so that at the last call i dont get error..which way, i should read it? let me give an example, suppose i have 100 chars, i can read it in 50 chars for twice or 10 chars in ten times or 25 chars for 4 times...like this. Here, file size, i.e 100 chars is known to me....but if the file size is unknown then how can i read in equal chunks so that at the last call i...
7
6062
by: John Dann | last post by:
I'm trying to read some binary data from a file created by another program. I know the binary file format but can't change or control the format. The binary data is organised such that it should populate a series of structures of specified variable composition. I have the structures created OK, but actually reading the files is giving me an error. Can I ask a simple question to start with: I'm trying to read the file using the...
0
2603
by: jimmyfishbean | last post by:
Hi, Please could comeone tell me how to programatically read the input message parts for a web service operation. I have a web service that has many operations. One of these operations (say op1) has the following input parameters: param1and param2. In VB6, I use the following extract of code (SOAP Toolkit 3):
20
2643
by: plmanikandan | last post by:
Hi, I need to read a file line by line.each line contains different number of characters.I opened file using fopen function.is there any function to read the file line by line Regards, Mani
3
3285
by: RJN | last post by:
Hi I've a template excel file which has all the calculations defined. There are certain input values to be entered which gives a lot of output to the user. I don't want to expose the excel sheet to the user as calculations become visible. I'm writing a web interface which takes the input values from user, updates the excel sheet and returns the recalculated output from the excel file. I'm using ADO.Net to update and read the excel file.
4
1676
by: Bill Nguyen | last post by:
I wonder if I can write to an XML file using column structure (and column names) of an SQLserver table. for example: Table A: column1 int column2 char(30) column3 date XML output:
1
5909
by: kushaljn | last post by:
Hi All, Not sure if some one has already addressed this Question before. I am writing a header of a CSV file using the following code. if (fileExists == false) { // Write the header row. StringBuilder header = new StringBuilder(); foreach (DataColumn col in tbl.Columns)
1
1397
by: fiftyone | last post by:
I have problems figure out how to delete a comment from a .xml file. I want to make code in c# that searchs through a folder and its subfolders and delete the first comment and comments matching a specific text. For example remove this comment from a .xml file: <!-- I want to delete this comment --> Anyone have some good ideas on how to attack this one?
1
4702
by: sachinkale123 | last post by:
Hi, I am reading excel file and reading values from that I am using provider As : "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " + Filename + ";Extended Properties=\"Excel 8.0;Hdr=No;IMEX=1\""; Column Name 'Sol 1' and 'Sol 2' is missing even though it is reading the readings. Just not able to read column names. I am not sure about what is exact problem. so please help me in solving this. Thanx in advance.
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
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...
0
8255
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
6799
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
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
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
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
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.