Zend - The PHP Company




XML

Add Code


AmazonLiteXMLParser  

Type: class
Added by: daniel1
Entered: 25/07/2002
Last modified: 07/12/2001
Rating: - (fewer than 3 votes)
Views: 8883
Parses Amazon's XML response (Web Service)


Borland MIDAS compartible SOAP Dataset application server  

Type: application
Added by: Denis3
Entered: 25/10/2002
Last modified: 07/12/2007
Rating: **** (3 votes)
Views: 9858
This code is application server that allows to display and edit database table contents with native Borland Delphi components using SOAP.


create xml file/output from mysql database using php  

Type: application
Added by: mrmihir
Entered: 18/06/2002
Last modified: 06/12/2001
Rating: **** (5 votes)
Views: 16126
This program will display the XML output of your existing database in MySql. You can enhance it by using fopen and fput function to write the output in the file called xml one


Dynamically transform XML and XSL with XSLT into Html without the Sablotron extension  

Type: application
Added by: xpc
Entered: 28/05/2002
Last modified: 06/12/2001
Rating: - (fewer than 3 votes)
Views: 10375
Transforms a (local|remote) XML file and its accompanying (local|remote) XSL file into html on the server using either a client output buffering in MSIE only or via a URL HTTP GET include via the W3's XSLT public web service.


Exporting table to a XML file  

Type: application
Added by: christophe_faizant
Entered: 22/04/2001
Last modified: 31/10/2008
Rating: **** (12 votes)
Views: 17447
Here is a function permetting to export datas provided by a database (mysql for this example) the goal beeing to include them into a XML file (this one will be automatically created).


fetching rss,xml archives  

Type: code fragment
Added by: goliche
Entered: 10/08/2001
Last modified: 09/12/2001
Rating: **** (4 votes)
Views: 10496
Using these coding lines xml can gather the existent information in any feed file. Only it is necessary to change her URL of the file to syndicate


Generate Dynamic XML/XSL File and its Transformation  

Type: code fragment
Added by: zubair
Entered: 12/06/2002
Last modified: 06/12/2001
Rating: **** (5 votes)
Views: 8917
This function give the Transformation to Page ... According to files that are feed to it .. Feed one Standard XML and its XSL files it will generates according transformation .... in Process of this it generates the Dyanamic XML files according data one want ...


Generate XML from PHP and mySQL  

Type: code fragment
Added by: iamtgo3
Entered: 14/05/2003
Last modified: 05/12/2002
Rating: - (fewer than 3 votes)
Views: 19601
This basic example will allow you to generate and XML file using PHP and data from your mySQL database. It also has the ability to save the XML Doc if you read through the code and uncomment the three lines of code that do it.


Handy SQL to XML function  

Type: code fragment
Added by: fluke2001
Entered: 30/10/2001
Last modified: 01/11/2000
Rating: ***** (4 votes)
Views: 8784
Quick and dirty generic function to parse multiple SQL queries into a DOM XML structure. Based on use with a PostgreSQL db. This SQL2XML function is somewhat stronger then the class-based one that can be found in the code gallery. Perhaps I'll extend / rewrite this function once the DOM XML functionality in PHP is stable.


mxml  

Type: class
Added by: h3
Entered: 12/12/2003
Last modified: 02/11/2002
Rating: - (fewer than 3 votes)
Views: 5440
This is a minimal, and hopefully simple class to get data out of a xml file via path query. Like; /rootNode/subnode/node .. if you don't understand read the code source, you'll dig it :) It was inspired from lots of great codes from the open source (mainly from zend.com and pear.php.net), wich are not necessarly related to xml, list them back would be too long and I would surely forget some, so i felt like I had to give it back to the open source. now make something better out of it :) to do: - add support for duplicate nodes. - add support fo namespaces. note to coders: - the $i & $o stands for input & output, i think it's a clean and efficient way to handle mainstream data trough functions. - this code may not be appropriate for proffessional use since it does not meet the industry standards and is still in beta developement - I think it can handle malformed or broken xml files without ending with infinites loops or crashing, but you shall respect some rules to in your xml file composition .. and avoid node repetition :/ i'll work on that soon. ** BOF file.xml ** data data ** EOF file.xml ** finally, feel free to report me bugs, suggestions or comments. - h3 at mindkind dot org


News manager  

Type: class
Added by: memtv
Entered: 12/07/2006
Last modified: 09/12/2005
Rating: - (fewer than 3 votes)
Views: 2631
This class for manage site news.


PHP XML Parsing Basics -- A Tutorial  

Type: code fragment
Added by: analysis
Entered: 08/05/2002
Last modified: 03/12/2003
Rating: **** (3 votes)
Views: 18647
Parsing XML files in PHP is complex. But, like most things, it's not that hard once you get the hang of it. I don't know about you, but I learn best by seeing actual code. So, here's a real world example. It grabs stock quotes off of NASDAQ's website.


phpDOM  

Type: class library
Added by: dglachs
Entered: 22/02/2001
Last modified: 02/12/2000
Rating: **** (6 votes)
Views: 14201

phpDOM is a class library for creating, extending and manipulating XML documents. It is based on the DOM/XML library of PHP 4.x. It acts as a wrapper to the functions provided by the DOM/XML library. It can be easily extended to reflect your needs and to create specific documents.

phpDOM includes two packages: phpDOM for pure XML, and phpDOM.XHTML for well-formed XHTML documents. These two packages can be used as examples of how to extend the base classes.

phpDOM "tries" to cover the W3C DOM specification and offers a similar syntax to all functions like the W3C specifaction. Since the library depends on the DOM/XML library it is currently not possible to provide all functions of the W3C DOM API, but it provides very good functionality to maintain XML documents as well as XHTML documents.

The code below is just a sample of how the library works, please refer to the "Example-Page" to get the entire library!



RDF (RSS) Parser  

Type: code fragment
Added by: uncleozzy
Entered: 04/09/2000
Last modified: 08/12/2000
Rating: - (fewer than 3 votes)
Views: 14720

Turn your site into a pseudo-portal! This snippet lets you include news items from other websites that provide RDF / RSS files. You may, however, want to cache the RDF file locally, as downloading it every time the page is hit is not only slow, but also rude.

Includes function parseRDF() which takes a filename (which can be a URL) as its parameter. Outputs HTML links for each item in the RDF file. Can also do images. Will die if the file is invalid.



SophosParse  

Type: class
Added by: bobtfish
Entered: 21/05/2002
Last modified: 05/12/2001
Rating: - (fewer than 3 votes)
Views: 4661
A parser to parse the (broken) rss feeds given out by Sophos (www.sophos.com) about their latest virus alerts..


sql2xml  

Type: class
Added by: chregu
Entered: 05/04/2001
Last modified: 04/12/2000
Rating: - (fewer than 3 votes)
Views: 9383
This class takes a sql-statement and returns a xml-represantation of your resultset on the fly. You can customize the output and also add more than one sql-query or an array.


Syntax Highlighting of XML  

Type: application
Added by: virtuoso
Entered: 13/06/2001
Last modified: 06/12/2000
Rating: - (fewer than 3 votes)
Views: 6667
A short script that displays a tagged file (XML, HTML, etc.) with syntax highlighting.


WML/WAP Toolkit  

Type: class library
Added by: DigitalIstBesser
Entered: 07/06/2002
Last modified: 06/12/2001
Rating: - (fewer than 3 votes)
Views: 6445
This is an OOP toolkit for creating WML-based applications and sites. It's not perfect yet, just a model. If anyone is interested in it, contact me, so I will send you the updated version which also checks for valid code. There's no documentation and no comments in the code. Just see the example.


XML @=@ Associative Array  

Type: class library
Added by: nickc1998
Entered: 03/08/2002
Last modified: 08/12/2001
Rating: **** (6 votes)
Views: 14334
Allows XML to easily be parsed into an Associative Array with many options. It also allows Associative Arrays (no limit on levels) to be converted to XML.


XML Driven Flash FLV Player  

Type: application
Added by: cortstull
Entered: 17/05/2004
Last modified: 05/12/2003
Rating: - (fewer than 3 votes)
Views: 14248
This Dynamic Flash FLV Progressive Video Player is powered by a PHP script that allows you to serve Flash FLV movies or video of any length from your website without needing Flash communications server. The FLV files are displayed using a Flash MX dropdown list which is dynamically populated by php in XML format to the player. The php script parses the working directory for any .FLV files and then generates that list in xml format which is loaded by the player.


XML easy parser  

Type: class
Added by: shadowman
Entered: 07/12/2000
Last modified: 04/12/2000
Rating: **** (7 votes)
Views: 13460
English:
This class:
            * it works with any document XML storages in file or variable;
             * It recovers data of any element or attribute;
             * It indicates which elements constitute the document XML;
             * It indicates which attributes belong to an element;
             * it treats the mistakes exhibiting the line and the column where is the mistake highlighting;
             * works with external entities.

Portugu�s:
Esta classe:
            * Trabalha com qualquer documento XML aramazenado em arquivo ou vari�vel;
             * Recupera dados de qualquer elemento ou atributo;
             * Indica quais elementos constituem o documento XML;
             * Indica quais atributos pertencem a um elemento;
             * Trata os erros exibindo a linha e destacando a coluna onde est� o erro;
             * Trabalha com entities externas.



XML Parsing/Output  

Type: class library
Added by: SolFolango
Entered: 25/08/2000
Last modified: 08/12/1999
Rating: **** (23 votes)
Views: 20792
With this easy to use classes (Node and XML) you can parse a XML file into a tree-equivalent instead of using the event-based parsing that PHP provides. All nodes (=elements) are inserted in an array, with data and attributes stored. This array can be then accessed. As an example, I wrote a function "print_nodes()" that prints the nodes in a nicely formatted way (similar to what IE5.5 does, when it encounters a XML file). Based on this example, you should easily work with the class (extending it). I hope, there are enough comments on this. Ah, forgot to mention: The print_nodes() can be formated with the vars $format_X in the XML-class. There are formatting possibilities for the element name, attributes, attribute values, the brackets, the identation etc. Fixed in v0.2 Node-print_name bug.


XML Reader 1.0  

Type: class library
Added by: hermawan
Entered: 20/06/2003
Last modified: 09/12/2002
Rating: - (fewer than 3 votes)
Views: 7420
Light XML Reader, you'll gonna need it to parse your XML content.


XML to ARRAY  

Type: code fragment
Added by: cashy
Entered: 01/02/2005
Last modified: 02/12/2004
Rating: - (fewer than 3 votes)
Views: 6635
Just a quick couple of functions to convert an xml feed into an array


XML to Heirarchal Array  

Type: code fragment
Added by: hashish101
Entered: 06/03/2005
Last modified: 03/12/2004
Rating: - (fewer than 3 votes)
Views: 4083
very simple function that allows you to pass in the result of PHP4's xml_parse_into_struct() function and makes it a hierarchal array. the "subtree" sub array contains the xml tags within the parent array.


XMLConfig - XML Configuration Tool  

Type: class
Added by: LiquidKernel
Entered: 15/03/2003
Last modified: 03/12/2002
Rating: - (fewer than 3 votes)
Views: 8126
After trying counless ways (objects, constants, etc) of storing configuration values for my applications, I decided to take on a more elegant approach: use an XML file.


xml_format  

Type: code fragment
Added by: shmert
Entered: 13/04/2002
Last modified: 05/12/2001
Rating: - (fewer than 3 votes)
Views: 5051
Converts domxml_dumpmem() xml (or any xml document) into human-readable, indented xml code.


xml_formatter  

Type: code fragment
Added by: shmert
Entered: 14/03/2002
Last modified: 03/12/2001
Rating: - (fewer than 3 votes)
Views: 4607
Adds indents and line breaks to an XML document, making for much easier viewing.


XMRPC server class and handler  

Type: application
Added by: xpc
Entered: 28/05/2002
Last modified: 06/12/2001
Rating: - (fewer than 3 votes)
Views: 5319
This is a server implementation of the new XMLRPC extension in PHP 4x. that can dynamically call a class and a specific class method based on the XML methodName parameter request.


XSLT Class (w/fallback mechanism for PHP @ 4.1.0)  

Type: class
Added by: kaoskind
Entered: 01/02/2002
Last modified: 02/12/2001
Rating: - (fewer than 3 votes)
Views: 6102
This class is a wrapper for the native xslt functions. There is a fallback mechanism that allows you to use every PHP 4 version, even though the function names have been changed since version 4.1



Search



This Category All Categories