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 = $dom->

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 beautifull

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

2010-02-02 Thread Andrew Ballard
ntents('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 > [snip] > // * now we come to the textarea bit that is not worki

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 iss

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

2010-02-02 Thread Ryan S
; >but no joy. > >I'm betting its pretty simple but i dont have a "DOM chart" for php, 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 ch

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

2010-02-02 Thread Ashley Sheridan
_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 > > $inputs = $dom->getElementsByTagName(

[PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Ryan S
de below. But a bit 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 $

[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

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 = n

[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); $DomObj->

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 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 . Is

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 wrote: Andrew Ballard wrote: On Wed, Mar 11, 2009 at 11:52 AM, 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

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 wrote: > Andrew Ballard wrote: >> >> On Wed, Mar 11, 2009 at 11:52 AM, 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 - b

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 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 Andrew Ballard
On Wed, Mar 11, 2009 at 11:52 AM, 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

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 everythin

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 ;

[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 $ta

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)

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'v

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 wors

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. > >>

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. > ht

[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 fai

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 : > >$cdata = 'foo' . "\0" . 'bar'; > > $dom = new DOMDocument('1.0', 'utf-8'); > $dom->formatOutput = true; > > $container = $dom->createElement('root'); > $blob =

[PHP] DOM - Question about \0

2008-03-16 Thread dav
Hi, I have question about \0 character with DOM : formatOutput = true; $container = $dom->createElement('root'); $blob = $dom->createElement('blob'); $blob->appendChild($dom->createCDATASection($cdata)); $container->appendChild($blob); $dom->appendChild(

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: $root->getAttributeNS(

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.. $root->lookupPrefi

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, 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 t

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 Jesse

Re: [PHP] DOM API Namespaces - help?

2008-01-24 Thread Per Jessen
Nathan Rixham wrote: > but assuming the above file is: > > http://www.w3.org/2001/XInclude";> > > > > 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 into a PHP variable? I would probab

[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.. http://www.w3.org/2001/XInclude";> I know I can retrieve the namespaceUri from the "xi:include" node using lookupNamespaceURI and ->prefix but I need to get it from where it's defined in "chapter" but assumi

Re: [PHP] manipulating XML via php DOM

2007-11-21 Thread pere roca ristol
ontophaugs332 > > > > > > > > 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 message from 19

Re: [PHP] manipulating XML via php DOM

2007-11-21 Thread Jonas Geiregat
you expect: genus ontophaugs332 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 message from 19th november, called "php > DOM question"

[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

[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 () and incrustate this tag in a predefined XML. This original XML is like this: ... userID nom U

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 types, say something like a real grid, or maybe a modal child popup? [/snip] [potential holy war bits] There is no su

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 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. :-) -- Some

Re: [PHP] DOM

2007-07-26 Thread Larry Garfield
a modal child popup? 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

[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 types, say something like a real grid, or maybe a modal child popup? -- @~@ Might, Courage, Vision, SINCERITY. / v \

[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 everything

[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 se

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 sta

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 d

Re: [PHP] DOM and XSLTProcessor

2007-04-09 Thread Tony Marston
f 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 On 4/9/07, Buesching,

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: &g

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

[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 pre

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: http://www

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 enti

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: loadXML("שלום"); $output = $dom->saveHTML(); header("Content-Type: text/html; charset=UTF-8"); echo html_entity_decode($output,ENT_QUOTES,"UTF-8"); ?> Yes. This works... thanks! :-) But

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

2007-03-21 Thread Tijnema !
On 3/21/07, Eli <[EMAIL PROTECTED]> wrote: > What about html_entity_decode? > http://www.php.net/html_entity_decode No. It doesn't help in this case. DOMDocument->saveHTML() method converts any non-ascii characters into entities. For example, if the dom document has the text node value of:

[PHP] Re: PHP DOM saveHTML outputs entities

2007-03-21 Thread Eli
What about html_entity_decode? http://www.php.net/html_entity_decode No. It doesn't help in this case. DOMDocument->saveHTML() method converts any non-ascii characters into entities. For example, if the dom document has the text node value of: שלום It converts the string to entities:

Re: [PHP] PHP DOM saveHTML outputs entities

2007-03-20 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 ab

[PHP] PHP DOM saveHTML outputs entities

2007-03-20 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 (http://www.php.net/

Re: [PHP] DOM File Permissions

2007-03-07 Thread Edward Vermillion
ned for the remote server(http://bushidodeep.com/ php/dom/appendData/appendData.php): DOMCharacterData->appendData example Load('./employee.xml'); //We retreive the attibute named id of the employee element $employee = $doc->getElementsByTagName('employee')->ite

Re: [PHP] DOM File Permissions

2007-03-07 Thread Edward Vermillion
ne 17 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 File Permissions

2007-03-07 Thread CK
ted 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): DOMCharacterData->appe

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: >> >> => >> > > No. > > Let me try to be more clear.. > Say you got the element , then I want the > DOMDocument > to automatically convert the 'key' attribute to an ID-Attribute, as > d

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 , 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 DOMDocument::getElement

Re: [PHP] DOM Element default ID attribute

2007-02-21 Thread Eli
Peter Lauri wrote: This was not clear for me, do you mean: => No. Let me try to be more clear.. Say you got the element , 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

RE: [PHP] DOM Element default ID attribute

2007-02-21 Thread Peter Lauri
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

[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 unsubscribe,

[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 us

[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 = 'blah'; $doc = new DOMDocument( '1.0', 'UTF-8' ); $docFragment = $doc->c

[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 just

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

2006-09-15 Thread Richard Lynch
Crude outside-the-box work-around... You are only looking for This should give you offsets to the beginning/end of each DIV tag. I'm sure I've got a one-off error or I'm not tracking quite the right numbers, or that I'm tracking extra numbers you don't need, but the idea is sound. -- Like Mus

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 Question. No pun intended.

2006-09-14 Thread mwilliams
uot;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 -- PHP General Mailing

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 ca

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

2006-09-14 Thread Satyam
Sorry, I immediatly thought about the client side. No, I don't know there is any way on the server side with PHP. Satyam - Original Message - From: <[EMAIL PROTECTED]> To: "Satyam" <[EMAIL PROTECTED]> Cc: Sent: Thursday, September 14, 2006 4:16 PM Subject:

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

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: Sent: Thursday, September 14, 2006 2:12 AM Subject: [PHP] DOM Question. No pun intended. Hi All, 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 [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 h

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). H

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() && preg_match("/td[0|

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 ){

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

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 fo

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 fields on an external html page, where >> I just know some ids of the rows. >> Example: >> ... >> >> 1234 >> >> >>

Re: [PHP] DOM - parse HTML document

2006-09-11 Thread Satyam
helpful 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: Sent: Monday, September 11, 2006 11:11 PM Subje

[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 fields on an external html page, where I just know some ids of the rows. Example: ... 1234 1234 1234 1234 ... PS: Please note, that id is written mor

[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(

[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 t

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 read

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 $html = str_replace("", "", $html); Would that even work? On 1/23/06 2:52 PM, "Chris" <[EMAIL PROTECTED]> wrote: > Steve Cla

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 `` > >>I need my output HTML to conform to XHTML strict. > >> > >Since XHTML is XML, try ->saveXML()? > > > >Steve > > > I've tried t

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 `` 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 that it always

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 `` > 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, visit: http://ww

[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 tabl

[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] 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 DO

[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 (http://www.php.n

[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: I am unable to create the "" element with the "cac:" namespace p

[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: language="Javascript"> but I need it like this (because otherwise the javascript don't work

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

Petr Smith wrote: but it encloses it to CDATA section automatically like this: language="Javascript"> but I need it like this (because otherwise the javascript don't work): // First, script was using some bogus method names. Second

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

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 = "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\";>\n" . "\n" . "http://www.w3.org/1999/xhtml\"; xml:lang

  1   2   >