greenrc
asked on
Convert XML to CSV
I need to convert an XML file into a CSV file.
If i have an XML file formatted as follows:
<root>
<table1 id="100" description="this is a test" anotherfield="test test" />
<table1 id="101" description="this is a test" anotherfield="test test" />
<table1 id="102" description="this is a test" anotherfield="test test" />
<table1 id="103" description="this is a test" anotherfield="test test" />
</root>
The transformation needs to handle more fields
than shown in the example XML file above. Is there a way to loop through attributes?
Can you please provide me with a sample XSL file to tranform.
Thanks
If i have an XML file formatted as follows:
<root>
<table1 id="100" description="this is a test" anotherfield="test test" />
<table1 id="101" description="this is a test" anotherfield="test test" />
<table1 id="102" description="this is a test" anotherfield="test test" />
<table1 id="103" description="this is a test" anotherfield="test test" />
</root>
The transformation needs to handle more fields
than shown in the example XML file above. Is there a way to loop through attributes?
Can you please provide me with a sample XSL file to tranform.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
works like a charm
thanks robbert
thanks robbert
How can I make this handle nested nodes?
i.e. From:
<Area code="Lon">
<Destination name="London" country="England" />
</Area>
To:
Lon, London, England
Thanks
Nigel
i.e. From:
<Area code="Lon">
<Destination name="London" country="England" />
</Area>
To:
Lon, London, England
Thanks
Nigel
@Nigel_Ellis, better post a new question. It seems, that not everyone knows about your question here, to answer it.
<xsl:template match="@*">
<!--
some stuff
-->
</xsl:template>
>I need to convert an XML file into a CSV file
What output do you expect from the XML you have provided? I am far from understanding your idea.
Kind Regards,
Zlatin Zlatev, MCSD