Problem with appendChild and ellipsis... [message #173070] |
Sun, 20 March 2011 14:49  |
Dennis
Messages: 17 Registered: February 2004
Karma: 0
|
Junior Member |
|
|
When writing a DOMDocument I have code similar to this...
$title = $doc->createElement("title");
$item->appendChild($title);
$title_data = "Some data followed by an ellipses
";
$title_text = $doc->createTextNode($title_data);
$title->appendChild($title_text);
When I look at the resulting file the <title></title> is there but it is
empty. I displayed $title_text->wholeText and the string with the
ellipsis is there. So it appears that something in appendChild is
gagging on the ellipsis.
Any thoughts?
I wonder if there are other characters that might cause a problem.
--
Dennis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Problem with appendChild and ellipsis... [message #173101 is a reply to message #173079] |
Mon, 21 March 2011 08:53  |
Michael Fesser
Messages: 215 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
.oO(Dennis)
> On Sun, 20 Mar 2011 15:25:21 -0400, Jerry Stuckle
> <jstucklex(at)attglobal(dot)net> wrote:
>
>> BTW - if you had display_errors=on
>
> I thought I did, but I just looked again and it was off. It's on now.
>
>> Whenever I need ellipses I just use three periods (...).
>
> I do too.
For good typography you should use the correct characters. A " for
example is not a quote sign and ... are just three dots, but not an
ellipsis. But with Unicode you can use all the correct chars instead
of just their ugly ASCII replacements, like „“ and … for example.
> But the data I am extracting is from a WordPress table. For
> some reason the WordPress page/post editor insists on changing three
> periods to a single ellipsis.
Which is usually correct and recommended. You just have an encoding
problem somewhere. And if you don't fix it, it might also happen with
other special chars.
Micha
|
|
|