Re: array data to XML

From: Matt Grimm (mgrimm_at_healthtvchannel.org)
Date: 12/24/03


To: php-general@lists.php.net
Date: Wed, 24 Dec 2003 08:19:09 -0900

Of course. If it's a simple (short) array, you can just create a string
with the XML tags and array values, and write that to a file with an XML
extension.

More sexy would be to use the DOMXML functions in PHP.
http://us3.php.net/manual/en/ref.domxml.php

Guy named Kris wrote a great XML -> PHP script that you can find here,
although it may be more than you are looking for:
http://www.devdump.com/phpxml.php

I've written a DOMXML-based PHP -> XML function that takes Kris' structure
as input, if you're interested.

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: mgrimm@healthtvchannel.org
Web: www.healthtvchannel.org
"Chakravarthy Cuddapah" <cuddapah@cuddapahonline.net> wrote in message
news:7924BCEA3C04774587C0B41F98C09EAC011840@cuddapahonline.CuddapahOnline.local...
newbie ...
Is it possible to format data in array to XML and display ?
Thanks !


Relevant Pages

  • Re: Latest version of glossary
    ... such as XML, refer to the use of the term within that "namespace" using ... An n-dimensional data structure, S, is one where each element of S ... Whenever mathematics is applied to anything, ... associative array (while trying to do something in JavaScript, ...
    (comp.databases.theory)
  • Re: Serialization with XmlSerializer: how to set the XML root node to something different from <
    ... Daniel Cazzulino [MVP XML] ... >> So if it is an array of Foo that is being returned, ... > The point here is not controlling the serialization of the elements of an ... >> modified root node should de-serialize just fine. ...
    (microsoft.public.dotnet.xml)
  • Re: xml
    ... XML has no good array structure representation. ... of pointers into the DOM and as you iterate over the DOM, you fill the array in with these ... There are so many XML reader packages out there that there is no one way to do this. ...
    (microsoft.public.vc.mfc)
  • XML help
    ... I'm 4 months new to python and 4 hours new to XML. ... understand and use the DOM tree walk sample shown at this site: ... walk the tree I temporarily store IDs and DeptValues in lists. ... I then intend to create an array of size determined by the maximum ...
    (comp.lang.python)
  • Re: Serialization with XmlSerializer: how to set the XML root node to something different from <
    ... > So if it is an array of Foo that is being returned, ... The point here is not controlling the serialization of the elements of an ... array, but of the array itself, in other words of the xml root element. ... array is indeed very simple (XmlArrayAttribute and XmlArrayItemAttribute is ...
    (microsoft.public.dotnet.xml)