Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 13th, 2004, 06:08 AM
Registered User
 
Join Date: Apr 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete sections according to their ID

Hi All,

I need to get help again since I got a difficult problem which I spend so much time and can’t solve it by myself. I try to compare two Segments, and if their IDs match, then delete the sections. The following is the original XML file. I need to compare the CBAParty’s relatedID with Party’s uniqueID. If their IDs match each other, then delete the corresponding CBAParty section.

<CBAEnvelope>
    <CBAPartySegment>
        <CBAParty>
            <RelatedEntityRef RelatedID="P1"/>
            <Shortname>Mr J M Jones</Shortname>
        </CBAParty>
        <CBAParty>
            <RelatedEntityRef RelatedID="P2"/>
            <Shortname>Mr D Smiles</Shortname>
        </CBAParty>
        <CBAParty>
            <RelatedEntityRef RelatedID="P3"/>
            <Shortname>Mr M Brown</Shortname>
        </CBAParty>
        <CBAParty>
            <RelatedEntityRef RelatedID="P4"/>
            <Shortname>Mrs L Brown</Shortname>
        </CBAParty>
    </CBAPartySegment>
       <Application>
            <PartySegment>
           <Party>
               <Identifier UniqueID="P1"/>
           </Party>
                 <Party>
               <Identifier UniqueID="P2"/>
           </Party>
           </PartySegment>
       </Application>
</CBAEnvelope>

The following is supposed to be the outcome. The two CBAPartys with relatedID “P1” and “P2” have been deleted since these two IDs can be found in Party sections.

<CBAEnvelope>
    <CBAPartySegment>
        <CBAParty>
            <RelatedEntityRef RelatedID="P3"/>
            <Shortname>Mr D Smiles</Shortname>
        </CBAParty>
        <CBAParty>
            <RelatedEntityRef RelatedID="P4"/>
            <Shortname>Mrs L Brown</Shortname>
        </CBAParty>
    </CBAPartySegment>
       <Application>
            <PartySegment>
           <Party>
               <Identifier UniqueID="P1"/>
           </Party>
                 <Party>
               <Identifier UniqueID="P2"/>
           </Party>
           </PartySegment>
       </Application>
</CBAEnvelope>

Many thanks if anyone could give me some suggestion or example. Thanks for everyone’s time as well.

Kind Regards,

Ken







Similar Threads
Thread Thread Starter Forum Replies Last Post
Config Sections Muhammad Zeeshan BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 February 3rd, 2008 01:23 AM
Sections formatting s_chilkury Crystal Reports 0 December 21st, 2005 06:46 AM
Creating CDATA Sections falmouth XSLT 1 November 17th, 2004 07:19 AM
why not index.asp?id=1 can be www.myweb.com/?id=1 BurhanKhan Classic ASP Professional 11 September 6th, 2004 02:06 PM
How to move sections lxken XSLT 5 April 28th, 2004 06:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.