Sponsored Content
Top Forums Shell Programming and Scripting Why are the xml tags not visible? Post 302113455 by cbkihong on Friday 6th of April 2007 08:00:27 AM
Old 04-06-2007
Quote:
Originally Posted by photon
Could some one please tell me why, when I run the following
php code:
Code:
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<?php  
$readfile = file("rss_file.xml");

for ($k=0; $k<=count($readfile)-1; $k++) {
	    echo "$readfile[$k]<br>";
}
?>
</BODY>
</HTML>

the tags do not appear in output to my firefox browser?
The HTML tags do not appear because parsing stops due to the missing closing php tag. You probably do not have errors displayed by default so you do not see the error. Running on my system on the command line gives exactly the error.

Quote:
X-Powered-By: PHP/5.1.4
Content-type: text/html

<br />
<b>Parse error</b>: syntax error, unexpected '<' in <b>/home/cbkihong/-</b> on line <b>13</b><br />
 

10 More Discussions You Might Find Interesting

1. Web Development

images are not visible

hi, why my uploaded images are not visible both in front-end and back-end of my CMS ? See the picture: http://dl-client.getdropbox.com/u/72686/noPics.png I checked the GD library in php. It seems ok... http://dl.getdropbox.com/u/72686/GD.png thanks ---------- Post updated at... (0 Replies)
Discussion started by: aneuryzma
0 Replies

2. Solaris

folder not visible in ls -l

Hi, I have a strange problem. when i do ls i see a folder, say 'abc', but it disappears when i do ls -l. I cannot access or mv that folder. Solaris 10 (SPARC) doesn't allow me to create a new folder with the same name, as it already exists. 'file' command also doesn't recognize i 'abc'... (10 Replies)
Discussion started by: Mack1982
10 Replies

3. Shell Programming and Scripting

Data between XML Tags

<?xml version="1.0" encoding="iso-8859-1" ?> <TABLE> <TEST> <ID> 123 </ID> <name> abc </name> </TEST> <TEST> <ID> 123 </ID> <name> abc2 </name> </TEST> </TABLE> <TABLE> <TEST> <ID> 456 </ID> <name> def </name> </TEST> <TEST> ... (8 Replies)
Discussion started by: eskay
8 Replies

4. Shell Programming and Scripting

How to get values from xml tags?

Hi guys, Need ur help again. Source File is coming like this. sample two records are below: <?xml version="1.0"?> <Object> <Header> <XCOMVers>V1.0</XCOMVers> <REPORT>XXXXX</REPORT> <CODE>002</CODE> </Header> <IssueCard> <Record> <L>CAR SYSTEM -SSSSS ... (3 Replies)
Discussion started by: sene_geet
3 Replies

5. Shell Programming and Scripting

How to add the multiple lines of xml tags before a particular xml tag in a file

Hi All, I'm stuck with adding multiple lines(irrespective of line number) to a file before a particular xml tag. Please help me. <A>testing_Location</A> <value>LA</value> <zone>US</zone> <B>Region</B> <value>Russia</value> <zone>Washington</zone> <C>Country</C>... (0 Replies)
Discussion started by: mjavalkar
0 Replies

6. Shell Programming and Scripting

Shell Command to compare two xml lines while ignoring xml tags

I've got two different files and want to compare them. File 1 : HTML Code: <response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record... (1 Reply)
Discussion started by: Shaishav Shah
1 Replies

7. Shell Programming and Scripting

Compare two xml files while ignoring some xml tags

I've got two different files and want to compare them. File 1 : <response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record id="38,557"><columns><column><name>orge... (2 Replies)
Discussion started by: Shaishav Shah
2 Replies

8. Shell Programming and Scripting

How to add Xml tags to an existing xml using shell or awk?

Hi , I have a below xml: <ns:Body> <ns:result> <Date Month="June" Day="Monday:/> </ns:result> </ns:Body> i have a lookup abc.txtt text file with below details Month June July August Day Monday Tuesday Wednesday I need a output xml with below tags <ns:Body> <ns:result>... (2 Replies)
Discussion started by: Nevergivup
2 Replies

9. Solaris

Groups is not visible

OS : SunOS 5.8 I am trying to add a user ad3059 to the following groups, A B C D ( four groups A,B,C,D) When i use usermod command and add the user to the above groups, and go to > groups ad3059 other C D It doesnt show A and B groups and shows it as other.Please advice on how... (13 Replies)
Discussion started by: Revathi2089
13 Replies

10. UNIX for Beginners Questions & Answers

How to pull multiple XML tags from the same XML file in Shell.?

I'm searching for the names of a TV show in the XML file I've attached at the end of this post. What I'm trying to do now is pull out/list the data from each of the <SeriesName> tags throughout the document. Currently, I'm only able to get data the first instance of that XML field using the... (9 Replies)
Discussion started by: hungryd
9 Replies
GET_META_TAGS(3)							 1							  GET_META_TAGS(3)

get_meta_tags - Extracts all meta tag content attributes from a file and returns an array

SYNOPSIS
array get_meta_tags (string $filename, [bool $use_include_path = false]) DESCRIPTION
Opens $filename and parses it line by line for <meta> tags in the file. The parsing stops at </head>. PARAMETERS
o $filename - The path to the HTML file, as a string. This can be a local file or an URL. Example #1 What get_meta_tags(3) parses <meta name="author" content="name"> <meta name="keywords" content="php documentation"> <meta name="DESCRIPTION" content="a php manual"> <meta name="geo.position" content="49.33;-86.59"> </head> <!-- parsing stops here --> (pay attention to line endings - PHP uses a native function to parse the input, so a Mac file won't work on Unix). o $use_include_path - Setting $use_include_path to TRUE will result in PHP trying to open the file along the standard include path as per the include_path directive. This is used for local files, not URLs. RETURN VALUES
Returns an array with all the parsed meta tags. The value of the name property becomes the key, the value of the content property becomes the value of the returned array, so you can eas- ily use standard array functions to traverse it or access single values. Special characters in the value of the name property are substi- tuted with '_', the rest is converted to lower case. If two meta tags have the same name, only the last one is returned. EXAMPLES
Example #2 What get_meta_tags(3) returns <?php // Assuming the above tags are at www.example.com $tags = get_meta_tags('http://www.example.com/'); // Notice how the keys are all lowercase now, and // how . was replaced by _ in the key. echo $tags['author']; // name echo $tags['keywords']; // php documentation echo $tags['description']; // a php manual echo $tags['geo_position']; // 49.33;-86.59 ?> NOTES
Note Only meta tags with name attributes will be parsed. Quotes are not required. SEE ALSO
htmlentities(3), urlencode(3). PHP Documentation Group GET_META_TAGS(3)
All times are GMT -4. The time now is 04:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy