Hi,
I'm trying to read the results of a database query into an XML document but it's only read so far and stopping. The XML document is as follows: -
<?xml version="1.0" encoding="utf-8"?>
-
-
<night>
-
-
<name>Poontang</name>
-
-
<homePageSummary>Launches 26th November</homePageSummary>
-
-
<whatsOnPageSummary>Every Monday from 26th Nov Door price: £5/£4 Guestlist (07809867930)</whatsOnPageSummary
-
-
>
-
-
<description>Poontang is of course, a punch made from the fermented juice from the rare poonberry bush
-
-
. It became hugely popular during colonial times, it was a favourite of the Founding Fathers, drank constantly
-
-
by George Washington, as evedenced by his farewell address, 'I only took the job for the poontang'.
-
-
<br />
-
-
-
<br />
-
-
-
The first recorded recipe was printed in Ye Boston Globe. Unfortunately, poontang's immense popularity
-
-
was later learned to be the result of addictive qualities. <br />
-
-
-
<br />
-
-
-
The hunger for good quality poontang is said to have made a Bishop kick a hole in a stained glass window
-
-
. Withdrawl will occur, leading to unappealing physical &amp; mental consequences, including blue
-
-
balls, hairy palms &amp; lack of mental clarity. <br />
-
-
-
<br />
-
-
-
COME SEE THE POONTANG PANDA.... <br />
-
-
-
Performing its erotic pole dance routine <br />
-
-
-
Pouring free poontang punch from the stage <br />
-
-
-
Giveaway baby poontang panda cuddly toys <br />
-
-
-
and if your lucky he might just hump your leg! <br />
-
-
-
<br />
-
-
-
DRINKS <br />
-
-
-
Baby Champers 70p! <br />
-
-
-
Bottles of Sol &amp; Sambucca Shots &pound;1 <br />
-
-
-
Double Spirit &amp; Mixer inc Red Bull &pound;2.40 <br />
-
-
-
Poontang Pitchers &amp; Red Pig Pithcers &pound;5 <br />
-
-
-
Bottles of House Wine &pound;7 <br />
-
-
-
<br />
-
-
-
MUSIC <br />
-
-
-
Big Panda Party Tunes -&gt; Dance, R'n'B and Indie <br />
-
-
-
<br /></description>
-
-
<thumbnail>thumb447.jpg</thumbnail>
-
-
<flyer>poon_flyer451.jpg</flyer>
-
-
</night>
-
I'm using the following the try and sort out the entities. -
function html_numeric_entities($str)
-
{
-
return preg_replace('/[^!-%\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str);
-
};
-
-
$description = html_numeric_entities(html_entity_decode($row['description']));
-
$description = $night->appendChild($dom->createElement('description', $description));
-
But it's only getting so far. I've tried it with just html_entity_dec ode but it gets struck with ampersands and £ signs. So I be using htmlentities when writing to the database, along with addslashes and then html_entity_dec ode when reading from the database. I've also had problems with hyphens. The PHP code can create the database but the Javascript code that reads the XML document when I'm creating an Ajax.Request cannot.
Hopefully some kind soul can guide on what I'm doing wrong.
Thanks,
Sean
1 2132 pbmods 5,821
Recognized Expert Expert
Heya, Sean.
Instead of worrying about HTML entities, try using CDATA tags.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: HI-Lab * the Social Technology |
last post by:
Is there another function or a workaround to have same results of
html_entity_decode in php 4.1.x?
Thanks.
--
=======================================
HI-LAB the Social Technology
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
www.hi-lab.net
|
by: lawrence |
last post by:
Using the conversion to char sets described for these functions, is it
possible to get a whole string into some charset? I'm trying to figure
out a way to take invalid character sets from idiot users, and
translate the string so that in the end I have a string that won't
cause my XML to test invalid.
html_entity_decode()
htmlspecialchars()
htmlentities()
|
by: Markus Ernst |
last post by:
Hi
I have a string such as
Добро"
that shows the cyrillic word "?????" in the browser. Now I played around
with lots of examples and contributed functions in the manual
(html_entity_decode, strtr, convert_cyr_string ...) but was not able to
decode these entities. As browsers displays them correctly on my PC and Mac
|
by: sylvian stone |
last post by:
Hi,
I've been having problems encoding / decoding data, and can't seem to
figure out where I am going wrong.
I extract data from a mysql table with a line like:
$object_name = stripslashes(htmlspecialchars($row,
ENT_QUOTES));
|
by: Koen |
last post by:
Hi,
first of all, the machine setup
server 1:
- UDB2 7.2.5; COUNTRY=1, location = US, IBM1250 codepage
- Locale: US English; Regional Settings: English; Keyboard: Dutch;
decimal separator: .
server 2:
- UDB2 7.2.5 Client Tools
- Websphere 4.0.5
| |
by: jack turer |
last post by:
I have a database in pgsql (7.3.2) on redhat 9.
When I try a 'pg_dump mydb' to back up the database, I get:
pg_dump: could not find namespace with OID 2200
Verbose version is:
-bash-2.05b$ pg_dump -v mydb | more
pg_dump: saving database definition
pg_dump: reading namespaces
pg_dump: reading user-defined types
|
by: dgleeson3 |
last post by:
Hello All
I have VB code (.Net 2005) reading from an SQL server 2005 database.
Im getting InvalidCastException when doing reader.GetInt32(0)
Im simply reading an int from a simple database. It has two columns,
User and Tel number. User is filled with 1,2,3 and tel number has 3
telephone numbers.
The User data column is specified as (PK, int, not null) in MS SQL
|
by: nathj |
last post by:
Hi,
As you can tell by the subject of this post I'm having a spot of bother with htmlentities() and html_entity_decode().
I have built/am building a web site that allows user feedback. When the user enters their review of a resource it is stored in the database. It goes into a LONGTEXT field and what is entered is passed through htmlentities():
$reviewToStore = htmlentities($reviewEntered, ENT_QUOTES) ;
The results in the database...
|
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= |
last post by:
I get the above error in some of the ASP.NET web applications on a
server, and I need some help figuring out how to deal with it.
This is a rather long post, and I hope I have enough details that
someone who bothers to read all of it have some pointers.
Note, I have posted the stack trace and the code exhibiting the problem
further down so if you want to start by reading that, search for +++
Also note that I am unable to reproduce...
|
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: 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: 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...
|
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();...
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |