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

RE: Detecting a break in data

Subject: RE: Detecting a break in data
From: "Smith, Graham" <Graham.Smith@xxxxxxxxxx>
Date: Wed, 19 Jun 2002 10:30:56 -0400
detect word between xml xsl
Tom,
	It sounds like you got the gist of what I need to do.  The
individual records are in numbered sequence, and must be reported as such,
but then are in blocks of either 'KEY_DATA' or 'RECnn' type lines (each
block of RECnn is always preceeded by its own KEY_DATA).  The basic
structure is something like...

Rule 1: RecordTy (Key_Data in Type_01) = "1"
Rule 2: RemitID (Key_Data in Type_01) = NONE
Rule 3: CompNum (Key_Data in Type_01) = NONE
Rule 4: Sequence (Key_Data in Type_01) = Index
Rule 5: Vmhkey (Rec01 in Type_01) = SPXVDR SP_Field:In1
Rule 6: Activsw1 (Rec01 in Type_01) = IF( SPSUST SP_Field:In1=" ","N","Y" )
.
.
.
Rule 60: Vmorigin (Rec01 in Type_01) = NONE
Rule 61: VendorID (Key_Data in Type_02) = SPXVDR SP_Field:In1
Rule 62: RecordTy (Key_Data in Type_02) = "2"
Rule 63: RemitID (Key_Data in Type_02) = SPXRMT SP_Field:In1
Rule 64: CompNum (Key_Data in Type_02) = NONE
Rule 65: Sequence (Key_Data in Type_02) = Index
Rule 66: Vrvendid (Rec02 in Type_02) = SPXVDR SP_Field:In1
Rule 67: Vrremid (Rec02 in Type_02) = SPXRMT SP_Field:In1

...and I want to display this as...

Rule 1: RecordTy (Key_Data in Type_01) = "1"
Rule 2: RemitID (Key_Data in Type_01) = NONE
Rule 3: CompNum (Key_Data in Type_01) = NONE
Rule 4: Sequence (Key_Data in Type_01) = Index
---
Rule 5: Vmhkey (Rec01 in Type_01) = SPXVDR SP_Field:In1
Rule 6: Activsw1 (Rec01 in Type_01) = IF( SPSUST SP_Field:In1=" ","N","Y" )
.
.
.
Rule 60: Vmorigin (Rec01 in Type_01) = NONE

---

Rule 61: VendorID (Key_Data in Type_02) = SPXVDR SP_Field:In1
Rule 62: RecordTy (Key_Data in Type_02) = "2"
Rule 63: RemitID (Key_Data in Type_02) = SPXRMT SP_Field:In1
Rule 64: CompNum (Key_Data in Type_02) = NONE
Rule 65: Sequence (Key_Data in Type_02) = Index
---
Rule 66: Vrvendid (Rec02 in Type_02) = SPXVDR SP_Field:In1
Rule 67: Vrremid (Rec02 in Type_02) = SPXRMT SP_Field:In1

The form of the actual XML is...

    <MapRule rulenumber="4">
      <objectset>Sequence Key_Data Field:Type_01 Record:Out</objectset>
      <objectrule>=Index</objectrule>
    </MapRule>
    <MapRule rulenumber="5">
      <objectset>Vmhkey Rec01 Field:Type_01 Record:Out</objectset>
      <objectrule>=SPXVDR SP_Field:In1</objectrule>
    </MapRule>

... from which I am using for-each MapRule, @rulenumber, the first word of
objectset (aFieldname), the second word of objectset (Key/Record label), and
objectrule (RuleData) to produce the lines seen in the first sample above.

Because the records are already in the correct order, all I need to do is
detect any change in the value of the second word in objectset between two
adjacent MapRules.  Also notice that the Key_Data label is the same for the
Rec01 MapRules as it is for the Rec02 MapRules, so I can't use this field
for sorting.

Does this make my position any clearer, or just confuse you further?
Perhaps I need to push this data out to an intermediate XML file, and then
reprocess it - can this be done and the result viewed by double-clicking
only on the source XML file?

Thanks,
Graham.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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-2013 All Rights Reserved.