Advertisement

01.22.2007 at 05:17PM PST, ID: 22132449
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

CSV to XML transform and vice versa

Asked by daluu in Extensible Markup Language (XML), Extensible HTML (XHTML), Extensible Stylesheet Language Transformation (XSLT)

Tags: ,

Hi, I'm a newbie to XML. I've found some resources for converting CSV to XML, and vice versa. But they seem to cover only one kind of XML - where the data is enclosed in tags (no data as tag attributes).

I'm wondering if there is a way to do a conversion from CSV to XML and XML to CSV in the following formats. For XML to CSV, I know you can use XSLT but I don't know how to adequately write the XSLT.

Sample XML Format (this is what I'm given):

<input OrderID=”1232” CustomerID=”XYZ”>
      <group id=1>
            <Item ProductID=121>
                  <OrderLineID>1</OrderLineID>
                  <Units>1</Units>
                  <NumOfSites>1</NumOfSites>
                  <Type>1</Type>
                  <Timeperiod>45</Timeperiod>
            </Item>
            <Item ProductID=122>
                  <OrderLineID>2</OrderLineID>
                  <Units>1</Units>
                  <NumOfSites>1</NumOfSites>
                  <Type>2</Type>
                  <Timeperiod>45</Timeperiod>
               </Item>
        </group>
      <group id=2>
            <Item ProductID=123>
                  <OrderLineID>3</OrderLineID>
                  <Units>1</Units>
                  <NumOfSites>1</NumOfSites>
                  <Type>1</Type>
                  <Timeperiod>45</Timeperiod>
                </Item>
            <Item ProductID=124>
                  <OrderLineID>3</OrderLineID>
                  <Units>1</Units>
                  <NumOfSites>1</NumOfSites>
                  <Type>1</Type>
                  <Timeperiod>45</Timeperiod>
               </Item>
         </group>
</input>

Sample CSV format (this format, I can specify/rearrange. Below is what I think is best in terms of CSV format).

productID, orderLineID, unit, numSites, type, period, orderID, customerID, groupID
121,1,1,1,45,1232,XYZ,1
122,2,1,1,2,45,1232,XYZ,1
123,3,1,1,1,45,1232,XYZ,2
124,3,1,1,1,45,1232,XYZ,2

How can I convert from one format to the other and vice versa, if possible? In terms of implementation, I need a command line tool. Tool could be in Java, C/C++, .NET/C#, VBScript, or Perl. Something customizable would be preferred so I can adapt it when changes occur, so I'd like to have the source code, not just the binary.Start Free Trial
[+][-]01.23.2007 at 12:20AM PST, ID: 18373140

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Extensible Markup Language (XML), Extensible HTML (XHTML), Extensible Stylesheet Language Transformation (XSLT)
Tags: csv, xml
Sign Up Now!
Solution Provided By: Gertone
Participating Experts: 1
Solution Grade: A
 
 
[+][-]01.23.2007 at 12:32AM PST, ID: 18373182

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.23.2007 at 12:48AM PST, ID: 18373238

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.23.2007 at 10:47AM PST, ID: 18377544

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.23.2007 at 02:20PM PST, ID: 18380125

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.23.2007 at 02:32PM PST, ID: 18380248

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.23.2007 at 02:57PM PST, ID: 18380547

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.23.2007 at 03:07PM PST, ID: 18380673

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.23.2007 at 03:07PM PST, ID: 18380674

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.23.2007 at 04:40PM PST, ID: 18381337

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.24.2007 at 12:47AM PST, ID: 18383896

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.24.2007 at 11:02AM PST, ID: 18388784

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.24.2007 at 11:19AM PST, ID: 18388951

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32