Re: [PHP] XML DOM

2010-07-21 Thread Benjamin Hawkes-Lewis
On 21 Jul 2010, at 19:32, Ben Miller wrote: > Problem: > > If street2 (or any other field) has no value, PHP is outputting the XML node > as , which is producing a JS error when I try to call: > > .. > > street2 = x[i].getElementsByTagName("street2")[0].childNodes[0].nodeValue; > >

[PHP] XML DOM problem with getAttribute(string)

2008-06-11 Thread Borden Rhodes
Hullo! 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 language to add my ne

Re: [PHP] XML DOM

2003-11-03 Thread Burhan Khalid
Ian Williams wrote: I have an XML document as a string $strXml, that looks a little like this: 1 Bob Rover 2 Fred Fido What's the best way to grab a single value from this document? In the past (in VB), I have loaded the XML int

[PHP] XML DOM

2003-11-03 Thread Ian Williams
I have an XML document as a string $strXml, that looks a little like this: 1 Bob Rover 2 Fred Fido What's the best way to grab a single value from this document? In the past (in VB), I have loaded the XML into a DOM Document, a

Re[2]: [PHP] XML dom encode

2002-10-04 Thread Tom Rogers
Hi, Untested but it would be something like this: 0){ //Create DomDocument ob_start(); echo ''; $buffer = ob_get_contents(); ob_end_clean(); $doc = domxml_open_mem($buffer); //Get root node $root = $doc->document_element();

Re: [PHP] XML dom encode

2002-10-04 Thread Tom Rogers
Hi, Friday, October 4, 2002, 10:14:31 PM, you wrote: DÖJ> header("Content-Type: application/xml"); DÖJ> //query database records DÖJ> $connection = mysql_connect("localhost", "user", "pass") or die("can't connect"); DÖJ> mysql_select_db("webbish"); DÖJ> $query = "SELECT id, title, artist F

[PHP] XML dom encode

2002-10-04 Thread Davíð Örn Jóhannsson
0){ //Create DomDocument $doc = new_xmldoc("1.0"); //Add root note $root = $doc->add_root("cds"); //Iterate through result set while(list($id, $title, $artist) = mysql_fetch_row($result)){

Re: [PHP] xml dom support

2002-01-11 Thread Henning Sprang
Sandeep Murphy wrote: > hi, > > I am running PHPtriad on a win2k machine... when I run phpinfo() it > displays " XMLACTIVE" this means that the standart, expat based xml support ist active >but I keep getting an error "Fatal error: Call to > undefined function: xmldoc() in C:\apache\htd

[PHP] xml dom support

2002-01-11 Thread Sandeep Murphy
hi, I am running PHPtriad on a win2k machine... when I run phpinfo() it displays " XMLACTIVE" but I keep getting an error "Fatal error: Call to undefined function: xmldoc() in C:\apache\htdocs\example.php on line 24" What needs to installed/configured ?? TIA, sandeep -- PHP General Mai

[PHP] XML DOM: encoding attribute problems and namespaces

2001-09-13 Thread ZeNDeR-X
hi ;) Recently I've been using the DOM module of php and I have encountered a few problems. I am working on a quite advanced XML application and I am forced to use the PHP technology. I need to dynamically create XML documents. There's no problem with that when i simply use this statement: $doc =

[PHP] XML DOM: encoding attribute problems and namespaces

2001-09-13 Thread ZeNDeR-X
hi ;) Recently I've been using the DOM module of php and I have encountered a few problems. I am working on a quite advanced XML application and I am forced to use the PHP technology. I need to dynamically create XML documents. There's no problem with that when i simply use this statement: $doc =

Re: [PHP] XML-DOM

2001-02-05 Thread Peter Sabaini
On Mon, Feb 05, 2001 at 02:06:13PM +0100, Thomas Brusa wrote: > hello > I'm trying to parse and change a loaded xml-file using the DOM module. > I need to remove certain nodes and append new ones. > Is it really true that you can't remove a childnode > while working with dom. > in perl this woul

[PHP] XML-DOM

2001-02-05 Thread Thomas Brusa
hello I'm trying to parse and change a loaded xml-file using the DOM module. I need to remove certain nodes and append new ones. Is it really true that you can't remove a childnode while working with dom. in perl this would look somehow like this: $doc1->removeChild($tmpele); $t