> 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->
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
On Tue, Feb 2, 2010 at 2:29 PM, Ryan S wrote:
> Hey!
> i'm just starting with PHP's DOM-XML and need a little help please.
>
>
> Basically, first i am trying to see if a input like a textbox has a 'VALUE='
> associated with it, if yes, i leave it be, if no, i add a default value.
>
> This *is wor
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
>// I have even tried this instead of the above:
>
>foreach ($inputs2 as $input2) {
>if(!$input2->getAttribute("defaultValue")=="") {
>$input2->setAttribute("defaultValue","it works!");
>}
>}
>
>but no joy.
>
>I'm betting its pretty simple but i dont have a "DOM c
On Tue, 2010-02-02 at 11:29 -0800, Ryan S wrote:
> Hey!
> i'm just starting with PHP's DOM-XML and need a little help please.
>
>
> Basically, first i am trying to see if a input like a textbox has a 'VALUE='
> associated with it, if yes, i leave it be, if no, i add a default value.
>
> This *
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
http://www.jonasjohn.de/lab/htmlsql.htm ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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
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
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 -
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
[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
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 ;
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)
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
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
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.
>
>>
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
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 =
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(
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
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/')
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
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
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
[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
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
On Thursday 26 July 2007, Man-wai Chang wrote:
> 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?
[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
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
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,
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
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
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
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:
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:
I would bet it's the www, sorry about that. I've had to change the
user/group name for mine so it will sync up with the linux file
server permissions across NFS.
On Mar 7, 2007, at 2:56 PM, CK wrote:
Hi,
Thanks, attempted to use appServer without luck, these are the
choices:
On Mar
PHP needs read/write access to the files. More than likely PHP is
running as Apache so the files would need to be owned by Apache* (or
whatever PHP is running at), not System.
*Or at least give the Apache group (or whatever PHP is running at) r/
w access, that way you don't have to resort to
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
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
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
This was not clear for me, do you mean:
=>
Best regards,
Peter Lauri
www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free
-Original Message-
From: Eli [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 22, 2007 12:42 AM
To: p
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
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
[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
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
. . .at this point, I need t
[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
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:
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 th
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'm having HTML DOM t
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
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
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|
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 ){
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.
- 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
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
>>
>>
>>
To start with, an ID should never be repeated. A name can be repeated, an
ID shouldn't. That is why there is a function to get an array of elements
with a certain name but there is none to get a list of elements with the
same ID simply because there shouldn't be any. Something helpful in
tr
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
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
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
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
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
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
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
On Monday 12 September 2005 02:08 pm, Florent Monnier wrote:
> Hi,
>
> Is there a way to make dom xml applications compatible PHP4 and PHP5?
>
> Thanks
You can use the PHP_VERSION predefined constant or the function_exists(string)
http://us2.php.net/manual/en/function.function-exists.php
What I
> Is there any way I can copy an element from one DOM document to another
> without having to dissect the original node/element and create a new
> node/element from scratch using the new DOM document and append to it?
Never mind. Apparently I can use clone_node(). When I tried that before
I was
28 maj 2005 kl. 19.32 skrev Jared Williams:
childNodes contains the textnodes too, in this case the whitespace
between each of .
So, to put it in short words; how do I do to browse the
content of the element id="5" withuot doing it recursively? I
want to receive a list when I call childNod
> -Original Message-
> From: Victor Spång Arthursson [mailto:[EMAIL PROTECTED]
> Sent: 27 May 2005 17:25
> To: php-general@lists.php.net
> Subject: [PHP] DOM: browse childnodes but not recursively
>
> Ciao!
>
> I really hope someone can help me on this, since I have been
> putting in
Ok, that answers my questions.
Thanks a lot!
Chris
Yann Larrivée wrote:
Hello
If you don't wish to have XML support please use.
--disable-simplexml --disable-libxml --disable-xml
By Default, libxml is needed to compile PHP5.
It tries to load DOM. DOMXML is history :)
Hop this helps.
Yann
On Januar
Hello
If you don't wish to have XML support please use.
--disable-simplexml --disable-libxml --disable-xml
By Default, libxml is needed to compile PHP5.
It tries to load DOM. DOMXML is history :)
Hop this helps.
Yann
On January 9, 2005 13:35, Chris wrote:
> I'm currently compiling (at the .
Christian Stocker wrote:
Use $dom->createProcessingInstruction($target, $data) ;
and then append this to the document.
that could maybe work
see
http://ch.php.net/manual/en/function.dom-domdocument-createprocessinginstruction.php
for more details.
Thank you Christian, the following code worked fi
On Wed, 27 Oct 2004 13:52:13 +0100, Dusty Bin <[EMAIL PROTECTED]> wrote:
> I have a requirement to create an XML file which looks approximately like:
>
>
>
>
>Item Text
>...
>
>
> The file needs to be formatted.
>
> I built a dom using the Dom extension, creating a document, adding
>
On Tue, 31 Aug 2004 11:47:22 -0400, David Numan <[EMAIL PROTECTED]> wrote:
> It worked! Thank you so much!
no problem
> I couldn't find documentation for this anywhere. I think I will add a
> note on the DOM Function page in the php docs.
The properties are unfortunately not documented yet :( An
It worked! Thank you so much!
I couldn't find documentation for this anywhere. I think I will add a
note on the DOM Function page in the php docs.
-dave
On Tue, 2004-08-31 at 01:23, Christian Stocker wrote:
> On Tue, 31 Aug 2004 00:27:25 -0400, David Numan <[EMAIL PROTECTED]> wrote:
> > Hi
> >
On Tue, 31 Aug 2004 00:27:25 -0400, David Numan <[EMAIL PROTECTED]> wrote:
> Hi
>
> I'm working on a project using PHP5 and I'm using the DOM extension
> quite heavily. I need to be able to store various character entities
> such as $nbsp; and é Note: this is for a custom XML document, not
> stand
Hi,
Friday, October 24, 2003, 9:37:07 PM, you wrote:
S> Hello
S> I wonder if anyone can help me with this problem or suggest an alternative
S> strategy.
S> I have two PHP boxes, one windows box running PHP version 4.2.1 and DOM XML
S> version 2.4.9, and the other one a FreeBSD box running PHP ve
Hello,
As far as I know from Christian Stocker (the domxml maintainer) - they are
already pretty stable. They are tagged as "experimental" to avoid people
complaints about API changes (API changes are necessary because DOMXML
should have a DOM api, and it was pretty not like this at the beggining).
79 matches
Mail list logo