Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

parsing XML file
i have some problem when i try to print character data emitted by the xml
parser..

$parser = xml_parser_create('');
xml_set_character_data_handler($parser, "characterData");

function characterData($parser, $data)
Â_Â_echoÂ_nl2br($data);
this work fine..

but if i try this..
function characterData($parser, $data)
Â_Â_echoÂ_nl2br(trim($data));
all line feed are erased and no <br /> is added to the output..

i've tried to change the character encodings with no success..
bye the way i think that the problem is the encoding..

what i can do?

Report this thread to moderator Post Follow-up to this message
Old Post
unknown
04-15-05 08:56 PM


Re: parsing XML file
On Fri, 15 Apr 2005 17:32:30 GMT, unknown <user@host.network> wrote:

>but if i try this..
>function characterData($parser, $data)
>__echo_nl2br(trim($data));
>all line feed are erased and no <br /> is added to the output..

But that's what you asked for... read the docs for trim().

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool

Report this thread to moderator Post Follow-up to this message
Old Post
Andy Hassall
04-16-05 01:56 AM


Re: parsing XML file
Andy Hassall wrote:

> On Fri, 15 Apr 2005 17:32:30 GMT, unknown <user@host.network> wrote:
> 
>
>  But that's what you asked for... read the docs for trim().
>

thanks, resolved..
but by the way trim($string, "\n") don't work fine.. must use trim($string,
10) or trim($string, 0x20)

Report this thread to moderator Post Follow-up to this message
Old Post
unknown
04-16-05 01:56 AM


Re: parsing XML file
Andy Hassall wrote:

> On Fri, 15 Apr 2005 17:32:30 GMT, unknown <user@host.network> wrote:
> 
>
>  But that's what you asked for... read the docs for trim().
>

thanks, resolved..
but by the way trim($string, "\n") don't work fine.. must use trim($string,
10) or trim($string, 0x0A)

Report this thread to moderator Post Follow-up to this message
Old Post
unknown
04-16-05 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:20 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.