It seems to me that you didn't really read the answers provided.
Very simply, that code you found is bad advice, and not suited for what you are doing. It will only work for very, very, very simple arrays. There is no good way to escape your XML data properly.
- As a side note, stop passing xml data on the command line immediately!. It will probably create files (all the > characters will write to files), and may overwrite something important, or shell code within the xml may delete your files!
If you really want to use the array method, one way is to create a temporary file with your xml data, and pass that filename as an argument. Let me reiterate - Passing the data itself will not work.
Otherwise, please use one of the other methods suggested in this thread. They are all better ways of doing what you want. | [reply] |