473,494 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

xml parsing error, using php's asxml

18 New Member
Expand|Select|Wrap|Line Numbers
  1. $file = simplexml_load_file($url); {
  2.  
  3.  
  4.     foreach($file->entry as $post) {
  5.  
  6.  
  7.     $row = simplexml_load_string($post->asXML()); // after adding this line, i get error message
  8.  
  9.     $links = $row->xpath('//link[@rel="alternate" and @type="text/html"]');
  10.     echo (string) $post->title;
  11.     echo (string) $links[0]['href'];
I use this script to parse atom feed. At first didn't work because it couldn't pass the link's href attribute properly. I added $row and even though it worked, it gives an error : "namespace prefix gd for etag on entry is not defined". I'm searching this for hours, can't find a solution. Can anyone help please?
Feb 16 '13 #1
1 1659
Dormilich
8,658 Recognized Expert Moderator Expert
then you haven’t searched properly. it is known that SimpleXML doesn’t use Namespaces by default and how to incorporate them is an easy search.
Feb 17 '13 #2

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

Similar topics

1
3561
by: hwcowan | last post by:
Hello, I have started using SimpleXML and can do most things, but there are a couple of things that I can't seem to figure out. Currently, I can: 1. Open & load an XML file 2. Manually...
9
2902
by: RiGGa | last post by:
Hi, I want to parse a web page in Python and have it write certain values out to a mysql database. I really dont know where to start with parsing the html code ( I can work out the database...
2
14751
by: mandric | last post by:
Hello, Can someone please enlighten me on how to preserve the <!]> element when parsing an xml file or string with simplexml. I'm using libxml 2.6.16 and php 5.1.4. I tried a few variations,...
2
5116
by: pmlane2001 | last post by:
I have a PHP SOAP XML file size problem that I was wondering if anyone has seen before. I have an XML file that when I put it through my PHP script with 270 lines (13,082 KB) it works fine. If I...
0
2557
by: ErikaW | last post by:
Hi all, I've tried to google this but could not find a clear solution. I have a Web application developed in JDevloper using mostly html and Javascript. I have a pre-defined PDF form which I merge...
0
1743
LacrosseB0ss
by: LacrosseB0ss | last post by:
Hey community; What I would like to do is open an XML document and change whatever is in a given node using PHP. I have read some stuff on DOM but can't really figure it out. As well in the past...
1
1600
by: jamesm6162 | last post by:
I use function to change a password in an xml file using simplexml. It works fine on my local server, as well as from the remote server when I use firefox, But for some reason, when I use IE and test...
1
1562
by: Derik | last post by:
Oh, how I love SimpleXML. Lovelovelove. It's not powerful, but it put about 70% of the XML pie within easy reach of my questing, clublike fingers. And it's got DOM... interoperability, or...
3
1363
by: thesmithman | last post by:
Howdy folks, My XML file contains the contents of several web pages. Example: <allPages> <thisPage> <h1>Page Title</h1> <p>Some text, which contains an <a href="link.php">inline...
2
3954
anfetienne
by: anfetienne | last post by:
hi, ive got a simplexml code to create xml files it worked before and now when i go to test it i get this error message "Fatal error: Call to undefined function: simplexml_load_string() in...
0
7119
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,...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
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...
0
5453
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,...
0
4579
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...
0
3088
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...
0
1400
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 ...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
285
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.