xsl-list
[Top] [All Lists]

Help for a sophisticated XML to CSV transformation needed

2005-11-17 18:22:41
Hello,

I would like to transform a XML file (SVN export format) to CSV including a splitting of one XML field into several CSV fields.

The XML file has the format:

<?xml version="1.0" encoding="utf-8"?>
<log>
<logentry revision="4007">
<author>joedoe</author>
<date>2004-12-03T11:56:21.656953Z</date>
<paths>
<path action="M">/trunkv2/lib/obbisoft-out.xsd</path>
</paths>
<msg>DEF10123#BRS:YES#SRS:N/A#DDS:N/A#JUNIT:N/A[XSD file]#REVIEWED:johndon#COMMENT:evolution OPD IX : XML Grammary alignement</msg>
</logentry>
<logentry revision="4008">
<author>joedoe</author>
<date>2004-12-04T10:51:23.657832Z</date>
<paths>
<path action="D">/trunkv2/src/obbisoft/implementation008/businessobject/dc/ObbiPlatformProxy.java</path> <path action="D">/trunkv2/src/obbisoft/implementation008/businessobject/xml/ObbiXmlDhlaRoleGenericElt.java</path> <msg>CR00034#BRS:NO#SRS:YES#DDS:YES#JUNIT:YES#REVIEWED:johndon#COMMENT:Change request for LH and CO</msg>
</logentry>
<logentry revision="4009">
<author>johndon</author>
<date>2004-12-05T09:58:41.854933Z</date>
<paths>
<path action="D">/trunkv2/src/obbisoft/implementation008/businessobject/dc/ObbiTransportCMProxy.java</path> <path action="D">/trunkv2/src/obbisoft/implementation008/businessobject/xml/ObbiXmlTransfer.java</path> <msg>WP00005#BRS:YES#SRS:NO#DDS:N/A#JUNIT:N/A[Drag & Drop functionality]#REVIEWED:joedoe#COMMENT:Drag & drop didn't work for field time</msg>
</logentry>
<logentry revision="4010">
<author>johndon</author>
<date>2004-12-06T12:16:11.952914Z</date>
<paths>
<path action="D">/trunkv2/src/obbisoft/implementation008/businessobject/aggregated/ObbiServiceProviderAccess.java</path> <path action="D">/trunkv2/src/obbisoft/implementation008/businessobject/dc/ObbiAreaTpopProxy.java</path>
<msg>MAINTAIN#REQUESTED:donjohn#REVIEWED:joedoe#COMMENT:Refactoring</msg>
</logentry>
</log>

The <msg> field has the following two structures:

Structure 1
item01:CRxxxxx || WPxxxxx || DEFxxxxx (x=0-9)
item02:BRS: YES || NO || N/A
item03:SRS: YES || NO || N/A
item04:DDS: YES || NO || N/A
item05:JUNIT: YES || NO || N/A [JUnit  comment]
item06:REVIEWED: <name>
item07:COMMENT: <comment>
Delimiter: #

Structure 2
item01:MAINTENANCE
item02:REQUESTED: <name>
item03:REVIEWED: <name>
item04:COMMENT: <comment>
Delimiter: #

Now I want to have the for each path entry a record created with the following layout:

path;item01;item02;item03;item04;item05 part 1;"item05 part2";item06

where the leading text in item02-item06 is removed and item05 is splitted in two parts (comment enclosed in [] brackets is second part) e.g.

/trunkv2/lib/obbisoft-out.xsd;DEF10123;YES;N/A;N/A;N/A;"XSD file";johndon
/trunkv2/src/obbisoft/implementation008/businessobject/dc/ObbiPlatformProxy.java;CR00034;NO;YES;YES;YES;;johndon
/trunkv2/src/obbisoft/implementation008/businessobject/xml/ObbiXmlDhlaRoleGenericElt.java;CR00034;NO;YES;YES;YES;;johndon
/trunkv2/src/obbisoft/implementation008/businessobject/dc/ObbiTransportCMProxy.java;WP00005;YES;NO;N/A;N/A;"Drag & Drop functionality";joedoe /trunkv2/src/obbisoft/implementation008/businessobject/xml/ObbiXmlTransfer.java;WP00005;YES;NO;N/A;N/A;"Drag & Drop functionality";joedoe

Any idea how this can be done?

Any help is welcome

Regards

Michael

"Doubt is not a pleasant condition, but certainty is an absurd one." <Voltaire>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>
  • Help for a sophisticated XML to CSV transformation needed, "Michael Lindenau (geschäftlich)" <=