Can someone recommend a solution to the following problem:

We are given a data structure (as shown below) and we need to 'transform' it 
into another retulting structure.  Here is the input XML:

<?xml version="1.0" encoding="UTF-8"?>
<OperationResult>
        <Data>
                <AreaLightingMaintenance>
                        <Async>
                                <uploadEnrolments>
                                        <v1.0>
                                                <Result>
                                                        
<OutputFileName>Text</OutputFileName>
                                                        
<ExceptionFileName>Text</ExceptionFileName>
                                                        
<CustomerResultFileName>Text</CustomerResultFileName>
                                                        
<PremiseResultFileName>Text</PremiseResultFileName>
                                                        
<PostalAddressResultFileName>Text</PostalAddressResultFileName>
                                                        
<ServiceResultFileName>Text</ServiceResultFileName>
                                                        
<CustomerExceptionReportFileName>Text</CustomerExceptionReportFileName>
                                                        
<PremiseExceptionReportFileName>Text</PremiseExceptionReportFileName>
                                                        
<PostalAddressExceptionReportFileName>Text</PostalAddressExceptionReportFileName>
                                                        
<ServiceExceptionReportFileName>Text</ServiceExceptionReportFileName>
                                                        
<PostalAddressFileName>Text</PostalAddressFileName>
                                                        
<PremiseOutputFileName>Text</PremiseOutputFileName>
                                                        
<ServiceOrderExceptionFileName>Text</ServiceOrderExceptionFileName>
                                                        
<MeterReadingsExceptionFileName>Text</MeterReadingsExceptionFileName>
                                                        
<StatusFileName>Text</StatusFileName>
                                                        
<AcknowledgementFileName>Text</AcknowledgementFileName>
                                                </Result>
                                        </v1.0>
                                </uploadEnrolments>
                        </Async>
                </AreaLightingMaintenance>
        </Data>
</OperationResult>


The final structure that we need to achieve at appears as follows:

<?xml version="1.0" encoding="UTF-8"?>
<OperationResult>
        <Data>
                <Result>
                        <OutputFileName>Text</OutputFileName>
                        <ExceptionFileName>Text</ExceptionFileName>
                        <CustomerResultFileName>Text</CustomerResultFileName>
                        <PremiseResultFileName>Text</PremiseResultFileName>
                        
<PostalAddressResultFileName>Text</PostalAddressResultFileName>
                        <ServiceResultFileName>Text</ServiceResultFileName>
                        
<CustomerExceptionReportFileName>Text</CustomerExceptionReportFileName>
                        
<PremiseExceptionReportFileName>Text</PremiseExceptionReportFileName>
                        
<PostalAddressExceptionReportFileName>Text</PostalAddressExceptionReportFileName>
                        
<ServiceExceptionReportFileName>Text</ServiceExceptionReportFileName>
                        <PostalAddressFileName>Text</PostalAddressFileName>
                        <PremiseOutputFileName>Text</PremiseOutputFileName>
                        
<ServiceOrderExceptionFileName>Text</ServiceOrderExceptionFileName>
                        
<MeterReadingsExceptionFileName>Text</MeterReadingsExceptionFileName>
                        <StatusFileName>Text</StatusFileName>
                        <AcknowledgementFileName>Text</AcknowledgementFileName>
                </Result>
        </Data>
</OperationResult>

So we are essentially looking to position on the <Result> tag and delete the 
four immediate Parent Nodes (<AreaLightingMaintenance>, <Async>, 
<uploadEnrolments>, and <v1.0> - respectively).

Is there a code sample for fining a specific Child Node and working backwards 
to delete some of its Parent Elements?!  Or maybe there is yet another solution 
that someone could recommend?!

Thanks,
James




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to