PHP generating XML

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • petermichaux@yahoo.com

    PHP generating XML

    Hi,

    I think I am getting very close to figuring out a good method for using
    multiple PHP functions to generate parts of a single XML tree (that
    will then be transformed to XHTML).

    I have found two ways to use PHP to generate the composite XML
    DomDocument but do not know how to decide between them. I have made up
    an example of each method so you can see them and posted them on my
    site so the formatting is a little nicer.



    Also, I'm really curious about the pass by reference confusion that is
    in method one.

    Any suggestions are really appreciated!

    Thanks!!
    Peter

  • petermichaux@yahoo.com

    #2
    Re: PHP generating XML

    >Also, I'm really curious about the pass by reference confusion that is in method one.

    I figured that out. PHP5 automatically passes object instances by
    reference so the & is implicit and unnecessary.

    So I don't see anything wrong with using Method 1 but I'm still
    interested if there is an argument against it.

    One thing is it is not object-oriented programming. I don't know how I
    would make it object-oriented and easier to use.

    Thanks,
    Peter

    Comment

    Working...