Forum Moderators: open

Message Too Old, No Replies

Look for advice on the best way to do something

         

mattyb515

1:10 pm on Apr 5, 2007 (gmt 0)

10+ Year Member



So here's the situation. Our company contracted with someone to construct a new website. We want the website to dump orders into our office system so the company has the new site create 3 csv files. One has the customers billing/shipping info and order total. The second has all of the items, quantity, price, and the order number. The third has items that were discounted. The primary key for all three files is the order number. Our office system is able to accept xml, csv, tab, and pipe. There is also an area where I can specify an XSL filter file. I guess my question is what's going to be the best way to get the 3 files read into our office system? Should I combine all three files into 1 xml file and then read it in? Our office system is Windward System 5 if it makes any difference. Thanks in advance for all of the advice.

cmarshall

1:31 pm on Apr 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, it depends upon whether you need just the data, or if you need formatting and styling.

Here's what XSLT is good for: You can generate a single set of data from something like a PHP file, and then, depending upon runtime variables, repurpose the data for different destinations.

If you are going to be displaying it on a standard Web page, you might add positioning/styling information to the data.

If you are going to be sending it to a cellphone, you may strip out almost all of the parts that do not directly meet the needs of data display on the cellphone.

If you are printing (by creating a printer-friendly page), you may want to rearrange the structure.

If you are exporting to another system, then you can strip out all of extra stuff, and send out a simple CSV.

XSLT is a fair bit of work. A stylesheet with any real-world significance can be every bit as large and hard to design/debug as a PHP file or a big DHTML file.

It is well worth it for multiple arbitrary destinations. I use XML in an "API" for one of the sites I design, and XSLT on the sites that use that API.

It may well not be worth it for a simple data export. For example, if you will have a pretty fixed Website design, and a basic CSV data interchange with your backoffice system, then why go to all the extra agita of doing it the XML way?

I can tell you that designing a "pure" XML system is not for the faint of heart. It is very powerful, and very kewl, but not easy or intuitive.

And never forget about learning curves. The chances are good that your first project may be a throwaway. If this is the case, you may not want it to be your crucial business site. Even if you will need to rewrite it in the future, you may be better off using tech that you know right now for your crucial system.

mattyb515

1:40 pm on Apr 5, 2007 (gmt 0)

10+ Year Member



The data is just needed. It doesn't need to be styled b/c no one will ever see it. It's just order info. coming from the website into our office system. We were just looking to eliminate the need to hand enter every order. I know that it can be done so I'm just trying to figure out the best solution. I've never used xml before but it seems fairly straightforward - I hope.

So can I assume that would parse the csv file in php then using xslt output the file to xml with all of the info. formatted properly?

cmarshall

1:59 pm on Apr 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've never used xml before but it seems fairly straightforward

No it's not.

Generating basic XML isn't a big deal, but applying XML is a very big deal. The XML community is chaotic and filled with a great deal of useless information. It's a real job to sift through it in order to find the gems you need. It seems that there are a great many people who know enough to be dangerous, and gleefully post wrong or incomplete information, and the people who do know what they are doing don't help us n00bs to make it over the very earliest stumbling blocks.

Every technology is "straightforward" when it is presented by academics in 100 lines or less.

It is a whole different story when you have to use it in real world situations.

Read the various threads I've posted here as I have been learning up on it.

Remember that I am a C++ expert, with more than twenty years of software development experience, and experience in learning many different programming languages:

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]

[webmasterworld.com...]