NYCPHP Meetup

NYPHP.org

[nycphp-talk] About XML in PHP

Paul Reinheimer preinheimer at gmail.com
Thu Dec 2 21:45:59 EST 2004


check out MiniXML, i discovered it while writing my book as a
SimpleXML alternative for PHP 4 users, but it has a lot of extra
functionality.

http://minixml.psychogenic.com


paul



On Thu, 02 Dec 2004 00:55:58 -0500, Jon Baer <jonbaer at jonbaer.net> wrote:
> im not sure you really want a parser function as much as you want to
> manipulate + outout the dom .. check out dom functions:
> 
> http://www.php.net/dom
> 
> example: (you can also load/modify/etc)
> 
> <?php
> $doc = new DOMDocument("1.0");
> $foo = $doc->createElement("foo");
> $foo = $doc->appendChild($foo);
> $bar = $doc->createElement("bar", "NYPHP Talk");
> $bar = $foo->appendChild($bar);
> echo $doc->saveXML();
> ?>
> 
> output:
> 
> <?xml version="1.0"?>
> <foo><bar>NYPHP Talk</bar></foo>
> 
> - jon
> 
> 
> 
> Amir Aavani wrote:
> > dear friends
> > i have a question about XML support in PHP. is there any class or
> > function or etc that allow the program to generate an XML
> > file(stream).I mean that it can add new node or new element or
> > atrribute by its input parameters.
> > for example if in its input, there is a 'login' message , it can add a
> > node 'Login' to its output XML, and in otherwise add a node 'not
> > login' or something like this.
> > i know that there are some parser function or classes in PHP but with
> > none of them you can't add a new node to the output XML.
> > thanks
> > Amir
> 
> pgp key: http://www.jonbaer.net/jonbaer.asc
> fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47
> 
> 
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.newyorkphp.org
> 


-- 
Paul Reinheimer
Zend Certified Engineer



More information about the talk mailing list