xm2array function

Discussion in 'XML' started by ~ el commandante ~, Dec 14, 2011.

  1. hi

    i am looking for a xml2array or xml2list code.
    I am searching for something in PHP but send me any code in any language
    you have. I need first to understand the trick.


    --
    mfg
    ~ el commandante ~
    ~ el commandante ~, Dec 14, 2011
    #1
    1. Advertising

  2. On 12/14/2011 6:56 AM, ~ el commandante ~ wrote:
    > i am looking for a xml2array or xml2list code.


    Your question can't be answered as you've posed it.

    XML is tree-structured data. How you convert that to an array or list is
    going to depend on what kind of document you're working with, what
    information you want to extract out of it, and how you want to organize
    that information.

    What are you actually trying to do? Specify exactly what kinds of input
    you want to process, and exactly what output you want to produce, and an
    answer becomes possible.


    --
    Joe Kesselman,
    http://www.love-song-productions.com/people/keshlam/index.html

    {} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
    /\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."
    Joe Kesselman, Dec 14, 2011
    #2
    1. Advertising

  3. ~ el commandante ~

    Peter Flynn Guest

    On 14/12/11 19:50, Joe Kesselman wrote:
    > On 12/14/2011 6:56 AM, ~ el commandante ~ wrote:
    >> i am looking for a xml2array or xml2list code.

    >
    > Your question can't be answered as you've posed it.
    >
    > XML is tree-structured data. How you convert that to an array or list is
    > going to depend on what kind of document you're working with, what
    > information you want to extract out of it, and how you want to organize
    > that information.
    >
    > What are you actually trying to do? Specify exactly what kinds of input
    > you want to process, and exactly what output you want to produce, and an
    > answer becomes possible.


    You could start with the little demo I wrote many years ago which
    converts an XML document to a CSV file. This is only meaningful for
    "data" XML (I shudder to think what you would get if you tried it on a
    TEI or DocBook document :)

    The code is at
    http://www.silmaril.ie/downloads/software/xml2csv/xml2csv.zip and I
    assume it still works, but it comes with no guarantees whatsoever :)

    (Incidentally, when I demo'd this at a course I taught at an early
    SGML/XML conference, I was approached by an irate gentleman afterwards
    who had just spent $30,000 on a consultant to write a C program to do
    the same thing. He wanted to know what the hell I thought I was doing
    making public a few lines of awk script...:)

    ///Peter
    Peter Flynn, Dec 23, 2011
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Vanns
    Replies:
    7
    Views:
    7,002
    Evan Carew
    Jan 21, 2004
  2. komal
    Replies:
    6
    Views:
    1,397
    msalters
    Jan 25, 2005
  3. Replies:
    2
    Views:
    882
    Bengt Richter
    Aug 1, 2005
  4. Giannis Papadopoulos

    Function pointer to void function and int function

    Giannis Papadopoulos, Sep 5, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,208
    Barry Schwarz
    Sep 5, 2005
  5. weafon
    Replies:
    1
    Views:
    281
    Diez B. Roggisch
    Jul 14, 2009
Loading...

Share This Page