Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 190439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:15:23+00:00 2026-05-11T16:15:23+00:00

My PHP application will need to be able to export to (and import from)

  • 0

My PHP application will need to be able to export to (and import from) a range of different data formats, mostly XML based.

I have the option of

  • In PHP, use DOM to export to some XML based format that is a superset of all the data needed by the others, and create a separate XSLT stylesheet for each output format I want to support, running the DOM output through PHP’s XSL extension.

or

  • Not using PHP’s XSL extension, but implementing each output format as a class in native PHP that translates directly from the internal objects/structures to a given XML format using DOM, each such class implementing the same interface so they are interchangeable.

The app will be used by universities and is a tool that manages ‘people’ records in various ways, and imports/exports from various sources like their HR system, etc. I’ll be implementing the set of input and output formats myself, but in future there is the chance that someone using it will want to modify it to support their own format.

One reason I’m considering NOT using XSLT is that if anybody else is going to maintain the app in future other than me, it seems that very few people even know XSLT – a lot more people seem to know PHP.

Another is that the second seems like a more efficient and ‘programmery’ solution, and more flexible in the sense that I’d be able to output to and import from non-XML formats like CSV or column based text just as easily by overloading the necessary parts of the class, not that that would often be necessary.

A third, but very small and insignificant reason is that PHP needs recompiling to enable XSL whereas DOM is enabled by default, so it would be a tiny bit more portable. However this isn’t too much of a problem as it’s easy to reconfigure PHP.

What do you think of my reasoning?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:15:23+00:00Added an answer on May 11, 2026 at 4:15 pm

    My personal opinion is that your decision should be based strongly on the fact how you’d judge the XSLT knowledge in your intended audience. If it’s clear that XSLT is somehow “terra incognita” among the people having to work with the system (that includes yourself), you can rule out the XSLT-solution. The need and the effort to learn XSLT will negate the advantages (very elegant – especially when transforming XML to XML, no need to mess with PHP code, no PHP knowledge needed) you’ll get from the XSLT-solution.

    Perhaps a two-way solution could be the right thing to go with. You could build an adapter-system for importing and exporting that uses XSLT for the XML data formats and provides the ability to use PHP code for all the data formats that aren’t XML based. This way every developer can choose the way he’s more comfortable with.

    interface My_DataConverter_Interface
    {
        /**
              * @param string                $file
              * @return My_DataObject
              */
        function import($file);
    
        /**
              * @param My_DataObject $data
              * @param string                $file
              */
        function export(My_DataObject $data, $file);
    }
    
    abstract class My_DataConverter_Xslt implements My_DataConverter_Interface
    { /* ... */ }
    
    class My_DataConverter_XmlFormat1 extends My_DataConverter_Xslt
    { /* ... */ }
    
    class My_DataConverter_XmlFormat2 extends My_DataConverter_Xslt
    { /* ... */ }
    
    class My_DataConverter_Csv implements My_DataConverter_Interface
    { /* ... */ }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 117k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer class Program { static void Main(string[] args) { Timer timer… May 11, 2026 at 10:50 pm
  • Editorial Team
    Editorial Team added an answer Use GROUP_CONCAT SELECT GROUP_CONCAT(bar) FROM TABLE GROUP BY foo; May 11, 2026 at 10:50 pm
  • Editorial Team
    Editorial Team added an answer Your code doesn't work because the function is not returning… May 11, 2026 at 10:50 pm

Related Questions

In my PHP application ( constructed using symfony framework and Propel ORM), when I
I'm writing a CMS application in PHP and one of the requirements is that
Part 1 I want to build a PHP Zend Framework application that users can
I'm building an application that needs to use a web server like a file

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.