[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-general
Subject:    [PHP] Parsing entities in XML attributes
From:       Gabriel Birke <birke () kontor4 ! de>
Date:       2004-06-23 12:50:04
Message-ID: D8FAFB73-C513-11D8-A370-003065FA313E () kontor4 ! de
[Download RAW message or body]

Hello!

I've got an XML file that has the following tag:
<customtext text="first line&lt;br /&gt;second line" />

I parse it with the following handler (simplified a bit):

function start_tag($parser, $name, $attrs)
{
	global $text;
	if($name == "CUSTOMTEXT")
		$text = $attrs['TEXT'];
	// more tags here ..
}

When I echo $text in a HTML page, I see a linebreak - just as I 
intended.

One of our customers has the script installed on his server and he 
doesn't see a linebreak but sees <br /> printed out. He has to write 
the tag like this:
<customtext text="first line <br />second line" />

Now I've got two questions:
1. Which tag is correct XML?
2. What is the cause of this?

I'm running the script with PHP 4.1.2 and EXPAT Version 1.95.2
Don't know what our customer has running.

With best regards

Gabriel Birke

-- 
KONTOR4_Neue Medien
Plathnerstraße 5
30175 Hannover
Fax: +49 51184 48 98 99
mailto:birke@kontor4.de
http://www.kontor4.de
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic