[PHP] Re: php get rss tag using DOM

2009-02-09 Thread Rob Richards
Morris wrote: I know rss_php, but it doesn't fit my solution. Is anyone able to help me with my question? thx 2009/2/8 Nathan Rixham Morris wrote: Hi, I am trying to write a programme to read a rss xml file. ... ... scan anyone tell me how to get the url attribute? I wrote some co

Re: [PHP] Re: Freeing memory for DOMDocument

2009-01-07 Thread Rob Richards
Nathan Rixham wrote: Jesús Enrique Muñoz Fernández wrote: Maybe you could find and answer here: *http://drupal.org/node/81037 Some people have the same problem, i was this trouble in the past and i fix it increasing the *memory_limit *in php.ini file* Anyway read the posts in the url that i

Re: [PHP] XML Get Value of Node DOMXPath

2008-12-16 Thread Rob Richards
Stephen Alistoun wrote: Hello all, Need help to get the value of the node. We know how to get the value of the city , item and itemPrice nodes below. How do we get the value of NumberOfRooms? $hotelElements = $xpath->query( '', $searchReponseElement );

[PHP] Re: XML DOM problem with getAttribute(string)

2008-06-11 Thread Rob Richards
ugh I'll keep it in mind). The returned string is still empty. I also unsuccessfully fetched the 'xmlns' attribute using getAttribute(). Interestingly, although hasAttributes(void) returns true, hasAttribute('xmlns'), and hasAttribute(' xml:lang') both re

[PHP] Re: XML DOM problem with getAttribute(string)

2008-06-11 Thread Rob Richards
Borden Rhodes wrote: I'm having a pig of a time trying to figure this one out: I have an XHTML document which I've loaded into a DOMDocument because I want to add more tags to it. However, since I live in a bilingual country, I want to get the document's xml:lang attribute so I know what langua

[PHP] Re: DOM - Question about \0

2008-03-16 Thread Rob Richards
dav wrote: Hi, I have question about \0 character with DOM : What to do with the character \0 ? encode this character to obtain : ? or skip the character with str_replace("\0", '', $cdata) ? CDATA is raw data and why it doesnt get magically encoded. If you remove the charac

[PHP] Re: Compile - libxml2

2007-11-12 Thread Rob Richards
Hi Benjamin, You really need to read the response more carefully. Benjamin Dupuis wrote: I've opened a bug report on bug.php.net, Compiling PHP in 5.2.2 is working with my libxml2, but not in 5.2.4 (and 5.2.5) but developpers say me that's not a bug : I must use XML2_DIR instead of XML_DIR,

Re: [PHP] php 5 soap question

2007-09-28 Thread Rob Richards
__getTypes() and __getFunctions() are your friends. They tell you alot about the functions and structure of parameters and return types. Rob Hurst, Michael S. wrote: I would have to get approval before I can do that. I can probably post a portion of the wsdl but not sure that it would be som

Re: [PHP] DOMDocument::schemaValidate() -> libxml_get_errors()

2007-04-06 Thread Rob Richards
Tijnema ! wrote: On 4/5/07, Sébastien WENSKE <[EMAIL PROTECTED]> wrote: Yes it's exactly the error, see the output : DOMDocument::schemaValidate() Generated Errors! Error 1871: Element 'EcheanceRMC': This element is not expected. in file:///D%3A/wamp/www/XML%20Validator/xml/Edit4.xml on lin

Re: [PHP] Re: SimpleXML & libxml options (XInclude)

2007-02-28 Thread Rob Richards
Ben Roberts wrote: So really when you perform: $dom = dom_import_simplexml($xml); the $dom object is really created by taking a reference to the $xml object rather than copying it? i.e. (I know this isn't real code) $dom = dom_import_simplexml(& $xml); Not exactly, but the idea is along

Re: [PHP] Re: SimpleXML & libxml options (XInclude)

2007-02-28 Thread Rob Richards
Ben Roberts wrote: Thanks Rob. That works. And it appears to work flawlessly if you subsequently convert it back to a SimpleXML object too: $xml = new SimpleXMLElement($xml_file, 0, true); $dom = dom_import_simplexml($xml); $dom->ownerDocument->xinclude(); $xml = simplexml_import_dom($dom); 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

[PHP] Re: Extending DOMNode

2007-02-15 Thread Rob Richards
Eli wrote: Rob Richards wrote: Due to the internals of the DOM extension, you need to register the class types that are actually instantiated and not the underlying base DOMNode class. Unfortunately in your case this means you need to register all of those classes separately. $dom

[PHP] Re: Extending DOMNode

2007-02-15 Thread Rob Richards
Eli wrote: registerNodeClass('DOMNode','MyDOMNode'); $dom->loadXML(''); echo $dom->firstChild->v; #<-- not outputs 10 ?> But I get the notice: PHP Notice: Undefined property: DOMElement::$v in ... I want the extension to be valid for all DOM nodes that are derived from DOMNode, such as DOM

[PHP] Re: How to prevent DomDocument from adding a !DOCTYPE.

2007-01-17 Thread Rob Richards
Mathijs wrote: I have some HTML content: Testing ØøÅå_^{}\[~]|[EMAIL PROTECTED]"#¤%&'()*+,ÖÑܧ¿äöñüà-./:;<=>?¡Ä Now i need to parse the HTML by getting all the class and id attributes and replace them with something else, and after that return the modified HTML.

Re: [PHP] How to prevent DomDocument from adding a !DOCTYPE.

2007-01-17 Thread Rob Richards
Mathijs van Veluw wrote: Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-16 15:37:09 +0100: Im using DomDocument currently and i realy want to prevent it from adding the !DOCTYPE and mabye even and etc.. Is this possible and how? Doesn't DOMDocument *require* DTD? I thought it's eith

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] transform RDF to HTML via XSL and PHP

2006-06-12 Thread Rob Richards
Mario Pavlov wrote: nope it doesn't work like this still the same result I think the problem is in the way that I'm accessing the elements how exactly this should be done ?... Its due to default namespaces in the feed. The item elements and its child elements are in the default namespace: h

[PHP] Re: XPath avg(), min(), max() functions not found

2006-06-08 Thread Rob Richards
Hi Alex, Alex wrote: Hi all. I'm trying to use XPath avg(), min() and max() functions without success. Others functions like count() or sum() works correctly. Here is the code I'm using (PHP 5.1): 25 7 50 3 '; $xml_doc = new DOMDocument(); $

Re: [PHP] Replacing text of a DOM text node

2006-06-07 Thread Rob Richards
Hi Frank, Frank Arensmeier wrote: > Jochem, thank you for your input! > > So, right now I am able to access all text nodes by e.g. > > $nodeElement -> parentNode -> childNodes -> item(0); -> returns Lenght, > Width and so on > $nodeElement -> parentNode -> childNodes -> item(1); -> is empty > $no

Re: [PHP] Re: Bug in XMLWriter?

2006-05-19 Thread Rob Richards
D. Dante Lorenso wrote: Rob Richards wrote: Expected behavior. See comments within code snippet. D. Dante Lorenso wrote: I am using XMLWriter with PHP 5.1.4 and find that it doesn't behave as I expect. I am under the impressing that until I call 'endElement', I should be f

[PHP] Re: Bug in XMLWriter?

2006-05-19 Thread Rob Richards
Expected behavior. See comments within code snippet. D. Dante Lorenso wrote: I am using XMLWriter with PHP 5.1.4 and find that it doesn't behave as I expect. I am under the impressing that until I call 'endElement', I should be free to continue adding attributes to an opened element regardles

[PHP] Re: DOMElement->setAttribute() loops forever (node_list_unlink bug?)

2006-05-15 Thread Rob Richards
Riku Palomäki wrote: Hello, I'm having problems with DOMElement->setAttribute() -method with my php script. I stripped down the code to this: -- $doc = new DOMDocument(); $doc->resolveExternals = true; $doc->loadXml('http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>'); $

Re: [PHP] I am not able to download domxml for PHP5

2006-04-11 Thread Rob Richards
Oz wrote: For some reason my PHP5 does not have DOM. ( I have the version that comes with fedora core 5). Is there a way to activate it. -thanks Oz You need to install the php-xml rpm to get the xml extensions (dom, xsl, xmlwriter and xmlreader). Rob -- PHP General Mailing List (http://ww

[PHP] Re: simplify DOM api

2006-03-07 Thread Rob Richards
Andreas Korthaus wrote: Rob Richards wrote: You can also look at using xmlwriter, when creating serialized trees, that automatically does escaping for you. Hm, AFAIK latest xmlwriter versions provide an OO API. Do you know about any documentation for it? I will try to add some time

[PHP] Re: simplify DOM api

2006-03-06 Thread Rob Richards
Andreas Korthaus wrote: I think this should be OK, or shouldn't I do it this way? Both ways are perfectly acceptable and all up to personal preference. In fact, to support the way you are doing it was one of the reasons why DOM classes were allowed to be extended. Perhaps you have seen that

[PHP] Re: Problems getting the nodeName with DomDocument

2005-12-23 Thread Rob Richards
Kenneth Andresen wrote: I am having problems with the following functions where my return simply is "#text Joe #text Smith #text unknown", it should have read firstname Joe lastname Smith address unknown What am I doing wrong? You're trying to access the name of the Text node which is always

[PHP] Re: XmlReader & XInclude

2005-12-14 Thread Rob Richards
Only the version of XMLReader in CVS HEAD does at the moment. Rob Jared Williams wrote: Hi, Does PHPs XmlReader support Xinclude ? Seems libxml does reading this post http://mail.gnome.org/archives/xml/2004-February/msg00190.html , but the corresponding constant seems missing in PHP

Re: [PHP] Re: XmlWriter::writeDTD bug...

2005-12-07 Thread Rob Richards
Jared Williams wrote: PS. Yeah, thought it was libxml, hence didn't file a pecl bug report. But there does seem a problem with this method as can't just have a publicId or a systemId, libxml function uses NULL as a parameter to specify which id you don't want to use. Which we've lost w

[PHP] Re: XmlWriter::writeDTD bug...

2005-12-06 Thread Rob Richards
Jared Williams wrote: Hi, $writer = new XmlWriter(); ... $writer->writeDtd('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); produces no whitespace between the public & system ids like... http://w

[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] Re: REQ: DOMDocument needs a way to format XML code

2005-11-11 Thread Rob Richards
Daevid Vincent wrote: I have a feature request (and I'm a bit disappointed that this isn't already in the DOMDocument, when there are nearly useless methods like "normalize()")... Ruby has this built in. xmllint has the --format parameter. But yet PHP's DOMDocument has no way of cleaning up the c

[PHP] Re: [PHP-XML-DEV] Re: [PHP] PHP5: ext/dom - set namespace of node manually

2004-02-22 Thread Rob Richards
From: Vivian Steller > i now can use the following syntax to set the namespaceUri of a node: > > $element = new DomElement("tagname", "value", "http://namespaceUri";); > // or > $element = new DomElement("pref:tagname", "value", "http://namespaceUri";); > // works

[PHP] Re: [PHP-XML-DEV] PHP5: ext/dom: Namespace & Prefix unexpected behavior

2004-02-18 Thread Rob Richards
> I thought that setting $root->prefix will set the prefix and the > namespaceUri to the other domain... but it seems to me that the parser > doesn't see the "xmlns:anotherprefix" as a prefix-declaration? > maybe i just misunderstood something, so please correct me if so. The current behavior is w

[PHP] Re: [PHP-XML-DEV] Re: [PHP] PHP5: ext/dom - set namespace of node manually

2004-02-16 Thread Rob Richards
From: Christian Stocker > > $node->setAttributeNS("http://www.w3.org/2000/xmlns/";, "xmlns:b", > > "http://www.somedomain.de/";); > > > IMHO, that would be very confusing. > > I liked the idea by vivian with a third optional namespaceURI argument > for the element object, so that at least you can

[PHP] Re: [PHP-XML-DEV] Re: [PHP] PHP5: ext/dom - set namespace of node manually

2004-02-16 Thread Rob Richards
> Porting the setNamespace function to PHP5 would be nice. Another solution > could be the possibility to append a namespace-node (is the > domnamespacenode class currently used by any functions?) or the > setAttribute checks wether some "xmlns"/"xmlns:" attribute is set and > updates namespaceUri