[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Comparing before and after records [SEC=UNCLASSIFI

Subject: Comparing before and after records [SEC=UNCLASSIFIED]
From: Enrico.Raymund@xxxxxxxxxxx
Date: Thu, 3 Jul 2008 16:58:07 +1000
 Comparing  before and after records    [SEC=UNCLASSIFI
Given this XML input

<?xml version="1.0" encoding="UTF-8"?>
<Events>
      <Before>
            <Event_Type>A</Event_Type>
            <Event_Field1>1111</Event_Field1>
            <Event_Field2>2222</Event_Field2>
            <Event_Field3>3333</Event_Field3>
            <EventId>1001</EventId>
      </Before>
      <Before>
            <Event_Type>B</Event_Type>
            <Event_Field1>1111</Event_Field1>
            <Event_Field2>2222</Event_Field2>
            <Event_Field3>3333</Event_Field3>
            <EventId>1002</EventId>
      </Before>
      <After>
            <Event_Type>A</Event_Type>
            <Event_Field1>1111</Event_Field1>
            <Event_Field2>2222</Event_Field2>
            <Event_Field3>3333</Event_Field3>
            <EventId>1001</EventId>
      </After>
      <After>
            <Event_Type>B</Event_Type>
            <Event_Field1>1111</Event_Field1>
            <Event_Field2>2233</Event_Field2>
            <Event_Field3>4444</Event_Field3>
            <EventId>1002</EventId>
      </After>
      <After>
            <Event_Type>A</Event_Type>
            <Event_Field1>1122</Event_Field1>
            <Event_Field2>2233</Event_Field2>
            <Event_Field3>3344</Event_Field3>
            <EventId>1003</EventId>
      </After>
</Events>

I need to output multiple XML files based on the number of unique
EventId's.  Filenames derived from {Event_Type}-{EventId}.xml.  Comments to
be generated

A-1001.xml
<?xml version="1.0" encoding="UTF-8"?>
<Event>
      <!-- unchanged -->
      <Field1>1111</Field1>
      <!-- unchanged -->
      <Field2>2222</Field2>
      <!-- unchanged -->
      <Field3>3333</Field3>
</Event>

B-1002.xml
<?xml version="1.0" encoding="UTF-8"?>
<Event>
      <!-- unchanged -->
      <Field1>1111</Field1>
      <!-- before: 2222 -->
      <Field2>2233</Field2>
      <!-- before: 3333 -->
      <Field3>4444</Field3>
</Event>

A-1003.xml
<?xml version="1.0" encoding="UTF-8"?>
<Event>
      <!-- new -->
      <Field1>1111</Field1>
      <!-- new -->
      <Field2>2233</Field2>
      <!-- new -->
      <Field3>4444</Field3>
</Event>

The creation of the multiple output document and the transformations are
easy.  The help I need is in comparing the <Before> and <After> contents
with the same <EventId>.

Thanks in advance,

Enrico Raymundo





--------------------------------------------------------------------
Important Notice: If you have received this email by mistake, please advise the sender and delete the message and attachments immediately.  This email, including attachments, may contain confidential, sensitive, legally privileged and/or copyright information.  Any review, retransmission, dissemination or other use of this information by persons or entities other than the intended recipient is prohibited.  DIAC respects your privacy and has obligations under the Privacy Act 1988.  The official departmental privacy policy can be viewed on the department's website at www.immi.gov.au. See: http://www.immi.gov.au/functional/privacy.htm

---------------------------------------------------------------------

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.