I have this PHP code that searches a online database for books. - <html>
-
-
<form method="post" action="getbookxml.php">
-
<input type="text" name="isbn_no" />
-
<input type="submit" value="Retrieve Book Details" />
-
</form>
-
-
</html>
-
-
<?php
-
-
$isbn_no = $_POST['isbn_no'];
-
header("Location: http://isbndb.com/api/books.xml?access_key=YSG2I2WU&index1=isbn&value1=$isbn_no");
-
-
?>
There isn't a problem with this part, but the output I receive on the browser is plain XML code like this: - <?xml version="1.0" encoding="UTF-8" ?>
-
- <ISBNdb server_time="2011-03-18T14:17:06Z">
-
- <BookList total_results="1" page_size="10" page_number="1" shown_results="1">
-
- <BookData book_id="a_civil_action_a01" isbn="0679772677" isbn13="9780679772675">
-
<Title>A civil action</Title>
-
<TitleLong />
-
<AuthorsText>Jonathan Harr</AuthorsText>
-
<PublisherText publisher_id="vintage_books">New York : Vintage Books, 1996.</PublisherText>
-
</BookData>
-
</BookList>
-
</ISBNdb>
Is there a method(using PHP if possible) where this xml code can be either converted into a table or saved as an excel or text file?
I don't want the user to see this XML code. I'd rather the result of their search to be a nice table or a file they can save.
Can anyone assist?
1 3170 Dormilich 8,658
Recognized Expert Moderator Expert
There isn't a problem with this part, but the output I receive on the browser is plain XML code
well, you request an XML document, even redirect to it …
how to process it depends on how you exactly want to do it as there are (as always) many different possibilities
- using XSLT (this transforms XML to some other XML/HTML/Text) (don’t recommend it for you)
- you can save it to disk using file_put_conten ts()
- you can treat it as string (though that may be difficult)
- you can load it into one of PHP’s XML classes ( SimpleXML, DOMDocument) and process that.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Padmaja |
last post by:
Hello
I want to convert a huge delimited text file (of appr 85MB) directly into XML. I dont want to loop through the text file and write as xml, as it is very large file and taking much time. Can any one help me, how to convert
Thanks in advance for all your help
Best Rgds
Padmaja.
|
by: Tobias Froehlich |
last post by:
Hi!
is it possible to extract all the code of a project (or a single .cs
file) into a text file? I mean of course I can just do ctrl-c and
ctrl-v, but it would be great if the colors would be kept and if it
would be somehow structured..
the problem is that I need to show someone the code of my project, but
on his computer there is no VC#. (and no, he can't come watch it on
mine :)
|
by: David |
last post by:
using c# in VS2003 in compact framework
Hi,
I am looking for some examples on how to convert a Dataset to text file.
My application reads the dataset from SQL Server and displays it in a
datagrid. I would like to take the data in the datagrid and send it to a
text file.
Any suggestions are welcome and appreciated
Thanks
|
by: Brad Sanders |
last post by:
Hello All,
I need a little help with a subject I am not very familier
with. I need to place into a text file several HEX codes
(0D 0C 0A). If I place these codes into the file with a
hex editor then when you open it with notepad the codes
show up as boxes (unknown ascii). That is exactly what I
need to do from vb.net. How to I write hex codes into my
text file?
|
by: Ilias Lazaridis |
last post by:
within a python script, I like to create a collection which I fill with
values from an external text-file (user editable).
How is this accomplished the easiest way (if possible without the need
of libraries which are not part of the standard distribution)?
something like:
text-file:
{peter, 16},
| |
by: sangith |
last post by:
Hi,
How do I convert a word document into a text file. (For eg: If I give input as file1.doc, my Perl program should automatically convert it into file1.txt)
Is there any Perl module which does this conversion?
I would appreciate your response!
Thanks in advance!
Sangith
|
by: jasvinder singh |
last post by:
Respected Sir/madam,
Can you help in providing code in 'C' for Reading text file with n number of rows and columns and putting the result in arrays.The sample file is as follows:
rim_label = 'aeff5'
state 0 = 'eee'
state 1 = 'ffffff'
.
.and so on...
|
by: veenna |
last post by:
How can i select utf-8 encoded character fro ma text file and bind it to dataset.
Here is the code:
Dim srStreamReader As StreamReader
Dim sFile As String = "E:\FTPROOT\uni.txt"
Dim swfile As String = "E:\FTPROOT\"
Dim sFileText As String
srStreamReader = New StreamReader(sFile, Encoding.Default)
sFileText = srStreamReader.ReadToEnd()
|
by: Hamayun Khan |
last post by:
Hi All
I have text files having queries like below.
INSERT INTO tblJobScrap (,,,,,,,,,) VALUES ('http://www.aberdeencity.gov.uk/webapps/images/genericicons/acc-logo.gif','Aberdeen','Scotland','School Crossing Patroller','No fixed closing date','£6.0100 p.h.','£6.37-£6.65 p.h.','Permanent','','http://www.aberdeencity.gov.uk/webapps/jobs/jobDetails.asp?id=5591')
INSERT INTO tblJobScrap (,,,,,,,,,) VALUES...
|
by: devquest |
last post by:
I have an xml file, and I need to convert it into a text file.
xml:
<?xml version="1.0" encoding="UTF-8" ?>
- <po-response xmlns="http://seller.marketplace.sears.com/oms/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://seller.marketplace.sears.com//SellerPortal/s/schema/oms/purchaseorder-v1.xsd">
- <purchase-order>
<po-number>2180031</po-number>
<po-date>2009-12-27</po-date>
...
|
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...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |