Re: [PHP] DOM TextArea (and dom chart please)

2010-02-03 Thread Michael A. Peters
Michael A. Peters wrote: $website_data = new tidy('dom_test.html',$tidy_config); Doh! Should be $website_data = new tidy('dom_test.html',$tidy_config,'utf8'); Otherwise it has the same problem with multibyte characters that loadHTML() has. But with the 'utf8' specified it works

Re: [PHP] DOM TextArea (and dom chart please)

2010-02-03 Thread Ryan S
I think what you are looking for is $input2-textContent in PHP. Hey Andrew (and everyone else was was kind enough to write back) ! Found the solution, this is what i am using (and it works!), and i hope it helps anyone else who finds themselves in the spot i found myself $inputs2 =

[PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Ryan S
confused as to how to do the same for a textarea as textarea's do not have a 'VALUE=' attribute. Heres my code: $website_data = file_get_contents('dom_test.html');//load the website data, $dom = new DomDocument; //make a new DOM container in PHP $dom-loadHTML($website_data); //load all

Re: [PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Ashley Sheridan
DOM container in PHP $dom-loadHTML($website_data); //load all the fetched data into the DOM container $inputs = $dom-getElementsByTagName('input'); // Find Sections foreach ($inputs as $input) { //*** this block has the guts of the functionality *** if(!$input-getAttribute

Re: [PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Ryan S
, the only ones i have been able to find via google are for javascript like this one: http://www.hscripts.com/tutorials/javascript/dom/textarea-events.php and that chart does not help much. Does anyone have a PHP DOM chart or a resource that i can use to get started using this? When I get stuck

Re: [PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Michael A. Peters
Ryan S wrote: $website_data = file_get_contents('dom_test.html');//load the website data, $dom = new DomDocument; //make a new DOM container in PHP $dom-loadHTML($website_data); //load all the fetched data into the DOM container I'm not sure what the answer to your issue is, but mind if I

Re: [PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Andrew Ballard
a new DOM container in PHP $dom-loadHTML($website_data);  //load all the fetched data into the DOM container [snip] // * now we come to the textarea bit that is not working * $inputs2 = $dom-getElementsByTagName('textarea'); // Find textareas foreach ($inputs2 as $input2

[PHP] DOM append to the top

2009-11-20 Thread Matthew Croud
Yo! I have a working form that adds user input to an XML file, it adds the new item element to the bottom of the list of previously created item elements. I would now like the new elements to be added to the top of the list. So far i've tried using: insertBefore() but i'm still getting

[PHP] Dom PDF Problem

2009-07-02 Thread Pravinc
Hey all, I am working with generating PDF using Dom PDF. My problem is when I generate a single PDF , Its working fine. But when I code it in a loop for generating more than one PDF it gives some error. $DomObj = new DOMPDF(); $DomObj-load_html_file($pth);

Re: [PHP] Dom PDF Problem

2009-07-02 Thread Paul M Foster
On Thu, Jul 02, 2009 at 04:29:01PM +0530, Pravinc wrote: Hey all, I am working with generating PDF using Dom PDF. My problem is when I generate a single PDF , Its working fine. But when I code it in a loop for generating more than one PDF it gives some error. $DomObj = new

[PHP] DOM Source of Selection

2009-05-22 Thread harihara krishnan
Hi I am working on a project wherein i have to extract information from a webpage and use it for processing. However that information becomes available only when i manually select a part of the webpage and view its source information (DOM source of selection ). Now i want this to be automated .

Re: [PHP] DOM Source of Selection

2009-05-22 Thread kranthi
http://www.jonasjohn.de/lab/htmlsql.htm ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] DOM - change a tag name ??

2009-03-11 Thread Michael A. Peters
If I'm manipulating a dom object, is there a way to change the tag name? I know you manipulate just about everything else in a node - but is the tagName really off limits? from the documentation for DOMElement - /* Properties */ readonly public bool $schemaTypeInfo ; readonly public string

Re: [PHP] DOM - change a tag name ??

2009-03-11 Thread Michael A. Peters
Michael A. Peters wrote: If I'm manipulating a dom object, is there a way to change the tag name? I know you manipulate just about everything else in a node - but is the tagName really off limits? from the documentation for DOMElement - /* Properties */ readonly public bool $schemaTypeInfo ;

RE: [PHP] DOM - change a tag name ??

2009-03-11 Thread Marc Christopher Hall
[mailto:mpet...@mac.com] Sent: Wednesday, March 11, 2009 1:40 PM To: php-general@lists.php.net Subject: Re: [PHP] DOM - change a tag name ?? Michael A. Peters wrote: If I'm manipulating a dom object, is there a way to change the tag name? I know you manipulate just about everything else

Re: [PHP] DOM - change a tag name ??

2009-03-11 Thread Andrew Ballard
On Wed, Mar 11, 2009 at 11:52 AM, Michael A. Peters mpet...@mac.com wrote: If I'm manipulating a dom object, is there a way to change the tag name? I know you manipulate just about everything else in a node - but is the tagName really off limits? from the documentation for DOMElement - /*

Re: [PHP] DOM - change a tag name ??

2009-03-11 Thread Michael A. Peters
Andrew Ballard wrote: On Wed, Mar 11, 2009 at 11:52 AM, Michael A. Peters mpet...@mac.com wrote: If I'm manipulating a dom object, is there a way to change the tag name? I know you manipulate just about everything else in a node - but is the tagName really off limits? from the documentation

Re: [PHP] DOM - change a tag name ??

2009-03-11 Thread Andrew Ballard
On Wed, Mar 11, 2009 at 3:06 PM, Michael A. Peters mpet...@mac.com wrote: Andrew Ballard wrote: On Wed, Mar 11, 2009 at 11:52 AM, Michael A. Peters mpet...@mac.com wrote: If I'm manipulating a dom object, is there a way to change the tag name? I know you manipulate just about everything

Re: [PHP] DOM - change a tag name ??

2009-03-11 Thread Michael A. Peters
Andrew Ballard wrote: On Wed, Mar 11, 2009 at 3:06 PM, Michael A. Peters mpet...@mac.com wrote: Andrew Ballard wrote: On Wed, Mar 11, 2009 at 11:52 AM, Michael A. Peters mpet...@mac.com wrote: If I'm manipulating a dom object, is there a way to change the tag name? I know you manipulate just

Re: [PHP] DOM recursion

2009-03-10 Thread Jochem Maas
please keep replies on list ... I enjoy my beatings in public ... Joanne Lane schreef: On Tue, 2009-03-10 at 01:05 +0100, Jochem Maas wrote: yeah but those from php-women should know better :-) my eye keeps picking up php-women since I had a very nice chat with JRF (of phpwomen.org) at

Re: [PHP] DOM recursion

2009-03-09 Thread Jochem Maas
Jochem Maas schreef: Joanne Lane schreef: I am trying to create a class that recursively iterates over an array an creates XML tree to reflect a multidimensional array. I am not really a PHP coder, but am trying my hand. I've seen 'real coders' write stuff thats leagues worse. This is

Re: [PHP] DOM recursion

2009-03-09 Thread Nathan Rixham
Jochem Maas wrote: Jochem Maas schreef: Joanne Lane schreef: I am trying to create a class that recursively iterates over an array an creates XML tree to reflect a multidimensional array. I am not really a PHP coder, but am trying my hand. I've seen 'real coders' write stuff thats leagues

Re: [PHP] DOM recursion

2009-03-09 Thread Jochem Maas
Nathan Rixham schreef: Jochem Maas wrote: Jochem Maas schreef: Joanne Lane schreef: I am trying to create a class that recursively iterates over an array an creates XML tree to reflect a multidimensional array. I am not really a PHP coder, but am trying my hand. I've seen 'real coders'

[PHP] DOM recursion

2009-03-05 Thread Joanne Lane
I am trying to create a class that recursively iterates over an array an creates XML tree to reflect a multidimensional array. I am not really a PHP coder, but am trying my hand. This is what I have so far. http://pastie.org/private/w75vyq9ub09p0uawteyieq I have tried a few methods, but I keep

Re: [PHP] DOM recursion

2009-03-05 Thread Jochem Maas
Joanne Lane schreef: I am trying to create a class that recursively iterates over an array an creates XML tree to reflect a multidimensional array. I am not really a PHP coder, but am trying my hand. I've seen 'real coders' write stuff thats leagues worse. This is what I have so far.

[PHP] DOM - Question about \0

2008-03-16 Thread dav
Hi, I have question about \0 character with DOM : ?php $cdata = 'foo' . \0 . 'bar'; $dom = new DOMDocument('1.0', 'utf-8'); $dom-formatOutput = true; $container = $dom-createElement('root'); $blob = $dom-createElement('blob');

Re: [PHP] DOM - Question about \0

2008-03-16 Thread Casey
On Sun, Mar 16, 2008 at 1:50 AM, dav [EMAIL PROTECTED] wrote: Hi, I have question about \0 character with DOM : ?php $cdata = 'foo' . \0 . 'bar'; $dom = new DOMDocument('1.0', 'utf-8'); $dom-formatOutput = true; $container = $dom-createElement('root'); $blob =

Re: [PHP] DOM API Namespaces - help?

2008-01-24 Thread Per Jessen
Nathan Rixham wrote: but assuming the above file is: ?xml version=1.0 ? chapter xmlns:xi=http://www.w3.org/2001/XInclude; a / /chapter how would one retrieve xmlns:xi=http://www.w3.org/2001/XInclude; When you say 'retrieve', what do you really mean? You need to get the namespace value

Re: [PHP] DOM API Namespaces - help?

2008-01-24 Thread Nathan Rixham
Thanks Jessen, I'm using the DOM API (domdocument) in PHP 5 - and yes pull xmlns:xi=http://www.w3.org/2001/XInclude; from the chapter or indeed any namespaces defined in the root node and store them in a variable. If anybody could shed any light it'd be greatly appreciated. Nathan Per Jessen

Re: [PHP] DOM API Namespaces - help?

2008-01-24 Thread Rob
Hi Nathan, You need to retrieve the attribute based on the xmlns namespace. Nathan Rixham wrote: Thanks Jessen, I'm using the DOM API (domdocument) in PHP 5 - and yes pull xmlns:xi=http://www.w3.org/2001/XInclude; from the chapter or indeed any namespaces defined in the root node and store

Re: [PHP] DOM API Namespaces - help?

2008-01-24 Thread Nathan Rixham
Cheers Rob, But this is the problem, I don't know what the namespace/prefix is! ie xi and the following doesn't work: $root-getAttributeNS('http://www.w3.org/2000/xmlns/', '*'); further xmlns is ?not? a prefix so this won't work either.. $root-lookupPrefix('http://www.w3.org/2000/xmlns/');

Re: [PHP] DOM API Namespaces - help?

2008-01-24 Thread Rob
Hi Nathan, Nathan Rixham wrote: Cheers Rob, But this is the problem, I don't know what the namespace/prefix is! ie xi and the following doesn't work: $root-getAttributeNS('http://www.w3.org/2000/xmlns/', '*'); further xmlns is ?not? a prefix so this won't work either..

Re: [PHP] DOM API Namespaces - help?

2008-01-24 Thread Nathan Rixham
Cheers indeed Rob! That DOMXPath solution is exactly what I was looking for; Many, Many Thanks, Nathan Rob wrote: Hi Nathan, Nathan Rixham wrote: Cheers Rob, But this is the problem, I don't know what the namespace/prefix is! ie xi and the following doesn't work:

[PHP] DOM API Namespaces - help?

2008-01-23 Thread Nathan Rixham
Help?? I need to get the namespaces from the root node of a DomDocument.. ?xml version=1.0 ? chapter xmlns:xi=http://www.w3.org/2001/XInclude; para xi:include href=book.xml /xi:include /para /chapter I know I can retrieve the namespaceUri from the xi:include node using lookupNamespaceURI

Re: [PHP] manipulating XML via php DOM

2007-11-21 Thread Jonas Geiregat
: And PropertyIsEqualTo PropertyNamegenus/PropertyName Literalontophaugs332/Literal /PropertyIsEqualTo Or/ Or/ /And Regards Jonas On Tue, 2007-11-20 at 10:27 -0800, pere roca wrote: please, I need some help with php DOM, for me it's becoming a hell! After trying other methods (check

Re: [PHP] manipulating XML via php DOM

2007-11-21 Thread pere roca ristol
Jonas On Tue, 2007-11-20 at 10:27 -0800, pere roca wrote: please, I need some help with php DOM, for me it's becoming a hell! After trying other methods (check message from 19th november, called php DOM question), I'm getting a little more success to manipulate XML. From the code you

[PHP] manipulating XML via php DOM

2007-11-20 Thread pere roca
please, I need some help with php DOM, for me it's becoming a hell! After trying other methods (check message from 19th november, called php DOM question), I'm getting a little more success to manipulate XML. From the code you can see below you generate this xml. Now I just want to keep only

[PHP] php DOM question

2007-11-19 Thread pere roca
hi everybody, I'm starting with the php DOM tools with some success. I want the user to dynamically alter the values of an xml tag (Filter) and incrustate this tag in a predefined XML. This original XML is like this: ... Rule Filter PropertyIsEqualTo PropertyNameuserID

RE: [PHP] DOM

2007-07-27 Thread Jay Blanchard
[snip] Out of curiosity, is there any effort in creating a new DOM that's easier for application builders (something like Visual Foxpro)? Does Web 2.0 or maybe 3.0 offer some new input types, say something like a real grid, or maybe a modal child popup? [/snip] [potential holy war bits] There is

Re: [PHP] DOM

2007-07-26 Thread Larry Garfield
? You're confusing two different things. The DOM is a standard API developed by the W3C for addressing tree data structures, generally XML or a data structure that maps to XML. It is language-independent, which is why the Javascript DOM functions look and act really really closely to the PHP

[PHP] DOM

2007-07-26 Thread Man-wai Chang
Out of curiosity, is there any effort in creating a new DOM that's easier for application builders (something like Visual Foxpro)? Does Web 2.0 or maybe 3.0 offer some new input types, say something like a real grid, or maybe a modal child popup? -- @~@ Might, Courage, Vision, SINCERITY.

Re: [PHP] DOM

2007-07-26 Thread Richard Lynch
On Thu, July 26, 2007 7:39 am, Man-wai Chang wrote: Does Web 2.0 or maybe 3.0 offer some new input types, say something like a real grid, or maybe a modal child popup? No, that would be a useful feature, and browser-makers have much more important (read: inane) features to implement. :-) --

[PHP] DOM support

2007-06-26 Thread Mikey
Hey! I have been looking through the docs writing test code and am going a little bit mad trying to work this out. Does anyone know where I can find a definitive list of DOM XML functions that are supported in specific versions of PHP? I write my code in Zend and it has 5.2.0, so

[PHP] Dom appendChild strips trailing text from within a node

2007-06-13 Thread Eric Wiener
I am trying to modify a node name and it mostly works, except that appendChild seems to strip the text that FOLLOWS after a subnode. Leading text and subnodes appear to be retained perfectly, just not text trailing the subnode. I tried using cloneNode, but that discarded the children even when I

RE: [PHP] DOM and XSLTProcessor

2007-04-10 Thread Richard Lynch
On Mon, April 9, 2007 3:50 am, Buesching, Logan J wrote: This could offer a possible workaround. Let me first state that I cannot simply do: echo htmlspecialchars_decode($proc-transformToXML($doc)); If I were to do that, then it would assume that all of these encodings need to be decoded;

RE: [PHP] DOM and XSLTProcessor

2007-04-10 Thread Buesching, Logan J
[mailto:[EMAIL PROTECTED] Sent: Tuesday, April 10, 2007 7:57 PM To: Buesching, Logan J Cc: Tijnema !; php-general@lists.php.net Subject: RE: [PHP] DOM and XSLTProcessor On Mon, April 9, 2007 3:50 am, Buesching, Logan J wrote: This could offer a possible workaround. Let me first state that I

[PHP] DOM and XSLTProcessor

2007-04-09 Thread Buesching, Logan J
Greetings, I apologize if this is a little long, but I am trying to put as much information as I have done in this first post. I am running PHP 5 and attempting to use DOM to create data to show on a webpage and using XSLTProcessor with an XSLT sheet to output it into XHTML. Everything is

Re: [PHP] DOM and XSLTProcessor

2007-04-09 Thread Tijnema !
On 4/9/07, Buesching, Logan J [EMAIL PROTECTED] wrote: Greetings, I apologize if this is a little long, but I am trying to put as much information as I have done in this first post. I am running PHP 5 and attempting to use DOM to create data to show on a webpage and using XSLTProcessor with

RE: [PHP] DOM and XSLTProcessor

2007-04-09 Thread Buesching, Logan J
for the idea though. -Logan -Original Message- From: Tijnema ! [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 4:40 AM To: Buesching, Logan J Cc: php-general@lists.php.net Subject: Re: [PHP] DOM and XSLTProcessor On 4/9/07, Buesching, Logan J [EMAIL PROTECTED] wrote: Greetings, I

Re: [PHP] DOM and XSLTProcessor

2007-04-09 Thread Tony Marston
it would add a lot of unnecessary overhead if it can be avoided. Thanks for the idea though. -Logan -Original Message- From: Tijnema ! [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 4:40 AM To: Buesching, Logan J Cc: php-general@lists.php.net Subject: Re: [PHP] DOM and XSLTProcessor

[PHP] PHP DOM saveHTML outputs entities

2007-03-21 Thread Eli
Hi, I'm loading a utf-8 xml file into PHP5 DOM, and then use saveHTML() method. The result output always convert characters to html entities in any case. How can I avoid this? I want to output utf-8 html string with no html entities. -thanks! -- PHP General Mailing List

Re: [PHP] PHP DOM saveHTML outputs entities

2007-03-21 Thread Tijnema !
On 3/21/07, Eli [EMAIL PROTECTED] wrote: Hi, I'm loading a utf-8 xml file into PHP5 DOM, and then use saveHTML() method. The result output always convert characters to html entities in any case. How can I avoid this? I want to output utf-8 html string with no html entities. -thanks! What

[PHP] Re: PHP DOM saveHTML outputs entities

2007-03-21 Thread Eli
: #1513;#1500;#1493;#1501; Although the string is already in UTF-8. The DOMDocument is already initialized with version 1.0 and encoding UTF-8, the php file is in UTF-8, the xml file is in UTF-8 and got ?xml version=1.0 encoding=UTF-8? header. Example: ?php $dom = new DOMDocument('1.0

Re: [PHP] Re: PHP DOM saveHTML outputs entities

2007-03-21 Thread Tijnema !
: ?php $dom = new DOMDocument('1.0','utf-8'); $dom-loadXML(htmlbodyשלום/body/html); $output = $dom-saveHTML(); header(Content-Type: text/html; charset=UTF-8); echo $output; ? -thanks Did you set the UTF8 format in the html_entity_decode function? so your code would become: ?php $dom = new

Re: [PHP] Re: PHP DOM saveHTML outputs entities

2007-03-21 Thread Eli
Tijnema ! wrote: Did you set the UTF8 format in the html_entity_decode function? so your code would become: ?php $dom = new DOMDocument('1.0','utf-8'); $dom-loadXML(htmlbodyשלום/body/html); $output = $dom-saveHTML(); header(Content-Type: text/html; charset=UTF-8); echo html_entity_decode($output

Re: [PHP] PHP DOM saveHTML outputs entities

2007-03-21 Thread Nicholas Yim
Hello Eli, Best regards, === At 2007-03-21, 15:13:29 you wrote: === Hi, I'm loading a utf-8 xml file into PHP5 DOM, and then use saveHTML() how save() method method. The result output always convert characters to html

Re: [PHP] PHP DOM saveHTML outputs entities

2007-03-21 Thread Eli
Hi Nicholas, Nicholas Yim wrote: how save() method The save() method, or actually saveXML() method dumps the DOM in XML format and not HTML format, and browsers do not know how to handle it correctly. -thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] DOM File Permissions

2007-03-07 Thread CK
changing the owner of each file to System and read/write for each file, with the same result, MAC OS 10.4.8, without success, what steps are needed to correct this? This source returned for the remote server(http://bushidodeep.com/php/ dom/appendData/appendData.php): bDOMCharacterData-appendData

Re: [PHP] DOM File Permissions

2007-03-07 Thread Edward Vermillion
DOMCharacterData-appendData example I attempted changing the owner of each file to System and read/ write for each file, with the same result, MAC OS 10.4.8, without success, what steps are needed to correct this? This source returned for the remote server(http://bushidodeep.com/ php/dom

Re: [PHP] DOM File Permissions

2007-03-07 Thread Edward Vermillion
for the remote server(http://bushidodeep.com/ php/dom/appendData/appendData.php): bDOMCharacterData-appendData example/b ?php $doc = new DomDocument; //Load the xml file into DOMDocument $doc-Load('./employee.xml'); //We retreive the attibute named id of the employee element $employee = $doc

Re: [PHP] DOM Element default ID attribute

2007-02-23 Thread Richard Lynch
On Wed, February 21, 2007 11:44 pm, Eli wrote: Peter Lauri wrote: This was not clear for me, do you mean: a peter = a id=peter No. Let me try to be more clear.. Say you got the element elem key=peter , then I want the DOMDocument to automatically convert the 'key' attribute to an

Re: [PHP] DOM Element default ID attribute

2007-02-22 Thread Rob Richards
Eli wrote: Let me try to be more clear.. Say you got the element elem key=peter , then I want the DOMDocument to automatically convert the 'key' attribute to an ID-Attribute, as done with DOMElement::setIdAttribute() function. The ID-Attribute is indexed and can be quickly gotten via

[PHP] DOM Element default ID attribute

2007-02-21 Thread Eli
Hi, I want to declare a default ID attribute to all elements in the document. For example: If an element got the attribute 'id' then I want it automatically to become the ID attribute of the element. How can I do that? -thanks! -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] DOM Element default ID attribute

2007-02-21 Thread Peter Lauri
, 2007 12:42 AM To: php-general@lists.php.net Subject: [PHP] DOM Element default ID attribute Hi, I want to declare a default ID attribute to all elements in the document. For example: If an element got the attribute 'id' then I want it automatically to become the ID attribute of the element. How can

Re: [PHP] DOM Element default ID attribute

2007-02-21 Thread Eli
Peter Lauri wrote: This was not clear for me, do you mean: a peter = a id=peter No. Let me try to be more clear.. Say you got the element elem key=peter , then I want the DOMDocument to automatically convert the 'key' attribute to an ID-Attribute, as done with DOMElement::setIdAttribute()

[PHP] DOM Validation using PHP

2006-11-13 Thread Raphael Martins
Hi there! I´m building a form validator using PHP and JS. It´s working fine by now, but I want to make a little improvement. Here is how its working now: 1. The user fill the form. Every time he leaves the field, the JS code match the value against a regexp to validate. 2. When the

[PHP] DOM: Problem with loadXML(), createProcessingInstruction()

2006-09-19 Thread Chris Boget
Apparently, loadXML() overwrites the existing structure of the document when called. The problem is that when I try to add a PI (namely a stylesheet), it adds it to the end of the document thus making so that the XML is not transformed by the client. To get around this, I thought I could

[PHP] [Solved] Re: [PHP] DOM: Problem with loadXML(), createProcessingInstruction()

2006-09-19 Thread Chris Boget
Has anyone found a workaround for this; a workaround the fact that loadXML() completely replaces the existing document structure? It's amazing what you find out after you've already made yourself look foolish. $xmlStr = 'rootchild_elementblah/child_element/root'; $doc = new DOMDocument(

Re: [PHP] DOM Question. No pun intended.

2006-09-15 Thread Richard Lynch
Crude outside-the-box work-around... You are only looking for div and /div and what's between them, right? Playing with strpos and a simple stack for nested DIVs should let you hack this in a crude parser: ?php //Untested code, off the top of my head: $divs = array(); $stack = array(); $offset

Re: [PHP] DOM Question. No pun intended.

2006-09-14 Thread Satyam
Try the properties innerHTML or outerHTML, the later will include the enclosing tag. Satyam - Original Message - From: Michael Williams [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thursday, September 14, 2006 2:12 AM Subject: [PHP] DOM Question. No pun intended. Hi All

Re: [PHP] DOM Question. No pun intended.

2006-09-14 Thread mwilliams
Satyam, I don't see any innerHTML or outerHTML in relation to PHP DOM. I'm familiar with them from a Javascript standpoint, but no references when it comes to PHP DOM. Regards, Mike Quoting Satyam [EMAIL PROTECTED]: Try the properties innerHTML or outerHTML, the later will include

Re: [PHP] DOM Question. No pun intended.

2006-09-14 Thread Satyam
: [PHP] DOM Question. No pun intended. Satyam, I don't see any innerHTML or outerHTML in relation to PHP DOM. I'm familiar with them from a Javascript standpoint, but no references when it comes to PHP DOM. Regards, Mike Quoting Satyam [EMAIL PROTECTED]: Try the properties innerHTML

Re: [PHP] DOM Question. No pun intended.

2006-09-14 Thread Rob
[EMAIL PROTECTED] wrote: Satyam, I don't see any innerHTML or outerHTML in relation to PHP DOM. I'm familiar with them from a Javascript standpoint, but no references when it comes to PHP DOM. Regards, Mike Now that you have the element, why not just call: $doc-saveXML($node); Rob

Re: [PHP] DOM Question. No pun intended.

2006-09-14 Thread mwilliams
to PHP DOM. I'm familiar with them from a Javascript standpoint, but no references when it comes to PHP DOM. Regards, Mike Now that you have the element, why not just call: $doc-saveXML($node); Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

Re: [PHP] DOM Question. No pun intended.

2006-09-14 Thread Rob Richards
[EMAIL PROTECTED] wrote: Rob, I wasn't aware that that would work. I mean I suppose it should, but basically this is what I'm doing: 1) Create a new DOMDocument 2) DOMDocument-loadHTML() 3) find the elements I want with getElementsByTag() then finding the one with the correct attributes

Re: [PHP] DOM - parse HTML document [solved]

2006-09-13 Thread tedd
At 12:07 AM +0200 9/13/06, Leonidas Safran wrote: Hello all, I have found a way... $doc = new DomDocument(); $doc-loadHTMLFile($source[url]); $elements = $doc-getElementsByTagName(tr); $i = 0; while( $elements-item($i) ){ if( $elements-item($i)-hasAttributes()

Re: [PHP] DOM - parse HTML document [solved]

2006-09-13 Thread Leonidas Safran
Hello Tedd, Interesting -- it doesn't work for me. I keep getting -- Parse error: parse error, unexpected T_OBJECT_OPERATOR -- in your if statement. But, I don't see the problem. Maybe it has something to do with your php version. I have php 5.04 installed (Fedora Core 4 rpm package).

Re: [PHP] DOM - parse HTML document [solved]

2006-09-13 Thread tedd
At 10:02 PM +0200 9/13/06, Leonidas Safran wrote: Hello Tedd, Interesting -- it doesn't work for me. I keep getting -- Parse error: parse error, unexpected T_OBJECT_OPERATOR -- in your if statement. But, I don't see the problem. Maybe it has something to do with your php version. I

[PHP] DOM Question. No pun intended.

2006-09-13 Thread Michael Williams
Hi All, I'm having HTML DOM troubles. Is there any way to output the *EXACT* code contained in a node (child nodes and all)? For instance, I perform a $doc-loadHTML($file) and all is well. I then search through the document for specific NODEs with getElementsByTagName(). However, when I

Re: [PHP] DOM - parse HTML document

2006-09-12 Thread Satyam
- Original Message - From: Leonidas Safran [EMAIL PROTECTED] By the way, because I found it strange to have more than one field with the same id, I looked on the famous selfhtml tutorial website http://de.selfhtml.org which says that unique id is only mandatory for css, but not for

Re: [PHP] DOM - parse HTML document

2006-09-12 Thread Leonidas Safran
Hello Satyam, That is correct but it is not complete. Everything that relies on a unique id would fail, CSS amongst others(which is what this article covers), but not the only one. Basically there are two functions to get elements by id or name: getElementById and getElementsByName.

Re: [PHP] DOM - parse HTML document [solved]

2006-09-12 Thread Leonidas Safran
Hello all, I have found a way... $doc = new DomDocument(); $doc-loadHTMLFile($source[url]); $elements = $doc-getElementsByTagName(tr); $i = 0; while( $elements-item($i) ){ if( $elements-item($i)-hasAttributes() preg_match(/td[0|1]/,$elements-item($i)-getAttribute(id)) 0 ){ echo

[PHP] DOM - parse HTML document

2006-09-11 Thread Leonidas Safran
Hello all, I don't really get it to work with that functions from http://www.php.net/manual/en/ref.dom.php I try to get the content of td fields on an external html page, where I just know some ids of the rows. Example: ... tr id = 'tr01' td1/tdtd2/tdtd3/tdtd4/td /tr tr id = 'tr02'

Re: [PHP] DOM - parse HTML document

2006-09-11 Thread Satyam
in traversing the DOM is any tool that gives you a good view of the tree structure. One such comes already in the Firefox browser. Satyam - Original Message - From: Leonidas Safran [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Monday, September 11, 2006 11:11 PM Subject: [PHP

Re: [PHP] DOM - parse HTML document

2006-09-11 Thread Leonidas Safran
Hello Satyam, Thanks for your answering... I don't really get it to work with that functions from http://www.php.net/manual/en/ref.dom.php I try to get the content of td fields on an external html page, where I just know some ids of the rows. Example: ... tr id = 'tr01'

[PHP] DOM XML : set_attribute()

2006-02-19 Thread Jils Abhilash
Hi, I am working with PHP 4.3 on windows. I am using PHP DOM functions to update the XML file. When I try to set the attribute of a particular node, the subsequent get returns the set value, but it doesn't reflect in the memory structure. echo ###,$build_node-get_attribute('path

[PHP] DOM/XML Query

2006-02-06 Thread Andrew Clarke
I'm having some problems using PHP5 on Windows 2000 Server, running IIS 5. When trying to access a document from a xmldoc() function the system responds with the following, *Fatal error*: Call to undefined function xmldoc() in *XML Document* on line *Number* ** How do I fix this problem? Is

[PHP] DOM saveHTML() not outputting XHTML Strict

2006-01-23 Thread Chris
Hi, I have a class which will build, and output, an HTML table. To create the internal elements more simply I'm using a DOMDocument, with a root element of 'table' then outputting with the -saveHTML() method. This has worked fine during development, but I've run into a problem. In this

Re: [PHP] DOM saveHTML() not outputting XHTML Strict

2006-01-23 Thread Steve Clay
Monday, January 23, 2006, 1:35:13 PM, Chris wrote: the -saveHTML() method ... outputs as `option selected` I need my output HTML to conform to XHTML strict. Since XHTML is XML, try -saveXML()? Steve -- http://mrclay.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] DOM saveHTML() not outputting XHTML Strict

2006-01-23 Thread Chris
Steve Clay wrote: Monday, January 23, 2006, 1:35:13 PM, Chris wrote: the -saveHTML() method ... outputs as `option selected` I need my output HTML to conform to XHTML strict. Since XHTML is XML, try -saveXML()? Steve I've tried that, and it suits my purposes except for the fact

Re: [PHP] DOM saveHTML() not outputting XHTML Strict

2006-01-23 Thread Michael Crute
On 1/23/06, Chris [EMAIL PROTECTED] wrote: Steve Clay wrote: Monday, January 23, 2006, 1:35:13 PM, Chris wrote: the -saveHTML() method ... outputs as `option selected` I need my output HTML to conform to XHTML strict. Since XHTML is XML, try -saveXML()? Steve I've tried that, and it

Re: [PHP] DOM saveHTML() not outputting XHTML Strict

2006-01-23 Thread Jay Paulson
I don't know much about the -saveXML() method but after reading the PHP manual why can't you just do something like this: $xhtml = $dom-saveXML(); // strip out the ?xml and ? $html = str_replace(?xml, , $html); $html = str_replace(?, , $html); Would that even work? On 1/23/06 2:52 PM, Chris

Re: [PHP] DOM saveHTML() not outputting XHTML Strict

2006-01-23 Thread Jay Paulson
ACK! Of course I put errors in the code. But I just read if you want to strip out the first line that would be easy. Just use a regular expression and take it out. :) On 1/23/06 3:23 PM, Jay Paulson [EMAIL PROTECTED] wrote: I don't know much about the -saveXML() method but after reading

[PHP] CDATA in PHP DOM

2005-12-01 Thread Guy Brom
Any idea what's wrong with the following? ($this_item['description'] has some html text I would like to paste as a CDATA section) $item-appendChild($dom-createElement('description', $dom-createCDATASection($this_item['description']))); Thanks! -- PHP General Mailing List

[PHP] Re: CDATA in PHP DOM

2005-12-01 Thread Rob Richards
Guy Brom wrote: Any idea what's wrong with the following? ($this_item['description'] has some html text I would like to paste as a CDATA section) $item-appendChild($dom-createElement('description', $dom-createCDATASection($this_item['description']))); createElement takes a string not a

[PHP] Re: CDATA in PHP DOM

2005-12-01 Thread Guy Brom
worked!! Rob Richards [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Guy Brom wrote: Any idea what's wrong with the following? ($this_item['description'] has some html text I would like to paste as a CDATA section) $item-appendChild($dom-createElement('description',

[PHP] DOM namespace prefix troubles

2005-11-02 Thread Ace McKool
Howdy folks, I'm using PHP 5.0.5 with the DOM enabled and I'm trying to create an XML doc with PHP. The problem I'm having is attaching a namespace prefix to a tag. What I'm trying to create is something like the following: ?xml version=1.0 encoding=UTF-8 ? Notes

[PHP] Re: PHP DOM XHTML - let me set my own javascript from code

2005-10-19 Thread Rob
Petr Smith wrote: but it encloses it to CDATA section automatically like this: script type=text/javascript language=Javascript![CDATA[alert('ddd');]]/script but I need it like this (because otherwise the javascript don't work): script type=text/javascript language=Javascript //![CDATA[

[PHP] Re: PHP DOM XHTML - let me set my own javascript from code

2005-10-19 Thread Petr Smith
Thanks a lot Rob, it's so simple! I don't know why I did't find it myself. Petr Rob wrote: Petr Smith wrote: but it encloses it to CDATA section automatically like this: script type=text/javascript language=Javascript![CDATA[alert('ddd');]]/script but I need it like this (because

[PHP] PHP DOM XHTML - let me set my own javascript from code

2005-10-18 Thread Petr Smith
Hi, I have problem with PHP DOM extension. How can I add my own javascript to javascript tag? I tried it using this code $html = !DOCTYPE html PUBLIC \-//W3C//DTD XHTML 1.0 Strict//EN\ \http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\;\n . \n . html xmlns=\http://www.w3.org/1999

  1   2   >