Re: [PHP] Using DOM textContent Property

2008-09-10 Thread Nathan Nobbe
On Wed, Sep 10, 2008 at 10:35 AM, Tim Gustafson <[EMAIL PROTECTED]> wrote: > Nathan, > > Thanks for your help on this. > > I actually need to do this a different way I think though. The problem is > that I'm not just replacing a text entity with a link entity. For example, > consider this paragr

RE: [PHP] Using DOM textContent Property

2008-09-10 Thread Tim Gustafson
Nathan, Thanks for your help on this. I actually need to do this a different way I think though. The problem is that I'm not just replacing a text entity with a link entity. For example, consider this paragraph: For information, please contact [EMAIL PROTECTED] In this case, I want "[EMAIL PR

Re: [PHP] Using DOM textContent Property

2008-09-09 Thread Nathan Rixham
Nathan Nobbe wrote: In my opinion, the DomNodeList class is useless. agreed; ever tried making a replacement node class that extends it? then you see how useless it is! [yet a vital part of the dom structure] ot here; but I thought maybe useful for reference; I do loads of xml/dom api wor

Re: [PHP] Using DOM textContent Property

2008-09-09 Thread Nathan Nobbe
On Tue, Sep 9, 2008 at 12:37 AM, Mario Trojan <[EMAIL PROTECTED]> wrote: > Hi Nathan, > > if you're already speaking of iterating children, i'd like to ask you > another question: > > Basically i was trying to do the same thing as Tim, when i experienced some > difficulties iterating over DOMEleme

Re: [PHP] Using DOM textContent Property

2008-09-08 Thread Mario Trojan
Hi Nathan, if you're already speaking of iterating children, i'd like to ask you another question: Basically i was trying to do the same thing as Tim, when i experienced some difficulties iterating over DOMElement->childNodes with foreach and manipulating strings inside the nodes or even rep

[PHP] Using DOM textContent Property

2008-09-05 Thread Nathan Nobbe
bouncing back to the list so that others may benefit from our work... On Fri, Sep 5, 2008 at 3:09 PM, Tim Gustafson <[EMAIL PROTECTED]> wrote: > Nathan, > > Thanks for the suggestion, but it's still not working for me. Here's my > code: > > === > $HTML = new DOMDocument(); > @$HTML->load

RE: [PHP] Using DOM textContent Property

2008-09-05 Thread Tim Gustafson
e tree. Tim Gustafson SOE Webmaster UC Santa Cruz [EMAIL PROTECTED] 831-459-5354 From: Nathan Nobbe [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 03, 2008 11:55 AM To: Tim Gustafson Cc: [EMAIL PROTECTED]; php-general@lists.php.net Subject: Re: [PHP] U

Re: [PHP] Using DOM textContent Property

2008-09-03 Thread Nathan Nobbe
On Wed, Sep 3, 2008 at 10:03 AM, Tim Gustafson <[EMAIL PROTECTED]> wrote: > > I think you might be better off using regexp on the text > > *before* sending it through the DOM parser. Send the > > user's text through a function that searches for URLs > > and email addresses, creating proper links a

RE: [PHP] Using DOM textContent Property

2008-09-03 Thread Tim Gustafson
> I think you might be better off using regexp on the text > *before* sending it through the DOM parser. Send the > user's text through a function that searches for URLs > and email addresses, creating proper links as they're > found, then use the output from that to move on to your > DOM stuff. T

Re: [PHP] Using DOM textContent Property

2008-09-03 Thread php
Tim Gustafson wrote: Hello, I am writing a filter in PHP that takes some HTML as input and goes through the HTML and adjusts certain tag attributes as needed. So, for example, if tag is missing the "title" attribute, this filter adds a title attribute to the tag. I'm doing this all using PHP

RE: [PHP] Using DOM textContent Property

2008-09-02 Thread Tim Gustafson
> if a node has children, then its not a leaf, so i imagine > you could continue to traverse until you reach the leaf > that actually has the address needing magical conversion. I tried that. $Element->hasChildNodes() returns true for just about everything except tags like and that have no corr

Re: [PHP] Using DOM textContent Property

2008-09-02 Thread Nathan Nobbe
On Tue, Sep 2, 2008 at 3:18 PM, Tim Gustafson <[EMAIL PROTECTED]> wrote: > And then I tried looking at the textContent property of each node, but it > seems that higher-level nodes include all the text of their children nodes > (which is what the DOM documents say it should). But there doesn't ap

[PHP] Using DOM textContent Property

2008-09-02 Thread Tim Gustafson
Hello, I am writing a filter in PHP that takes some HTML as input and goes through the HTML and adjusts certain tag attributes as needed. So, for example, if tag is missing the "title" attribute, this filter adds a title attribute to the tag. I'm doing this all using PHP 5 and the DOM parsing